nyyManni / ejira

Emacs JIRA integration
GNU General Public License v3.0
255 stars 36 forks source link

Conversion of Jira Markup to Org has a bug with comments including square brackets #17

Closed kat-co closed 3 years ago

kat-co commented 4 years ago

When I import tickets including these, the parser gets confused. In my case, the comment had a subsequent * and so an entire new top-level heading was created with the rest of the comment. This in turn disallowed refiling sub-tasks to their parents.

nyyManni commented 4 years ago

Would you happen to have a sample jira markup file that produces this error so that I could validate any fix against it?

MadEarl commented 4 years ago

I just stumbled over that problem as well. The text that triggered it was like

- email@domain.invalid[mailto:email@domain.invalid] - somestring
- anotheremail@domain.invalid[mailto:anotheremail@domain.invalid] - someotherstring

If you cannot reproduce it, I can try and send a complete example.

MadEarl commented 4 years ago

This is the exact string (names obfuscated) as retrieved by jiralib2-get-issue in the description field:

"Btsys ist eine XXX-Eigenentwicklung, d. h. entweder kann Solr direkt ersetzt werden, oder es wird eine Übersetzungsschicht entwickelt.

Testumgebung vorbereiten zum anprogrammiert werden.

User:

* Stanislav Bla [mailto:Stanislav.Blav@partner.domain.invalid] - qxo9988
* Mirza Foo [mailto:Mirza.Foo@partner.domain.invalid] - qxw9997
* Norbert Ra  [mailto:Norbert.Ra@partner.domain.invalid] - qxq9876
* Soenke Baz [mailto:Soenke.Bazt@partner.domain.invalid] - qxv1111

Auch Fgnrz-Demoumgebung freischalten?
"

It's probably related to some greedy matching? It also breaks the conversion of * to - so that the list items become top-level entries and end up partially in the next entry.

chaorace commented 4 years ago

I'm able to reproduce the issue as well. Here's the affected description field, as authored in Jira:

+Screenshot Transcription+
* "Can we change this to network operations?" _As opposed to sending the email to FOOBAR directly, as this email was_
* "[Can we clean this ticket description up]?" _Verbatim: "?"_
* "[Why does this say Additional comments in a client-facing email]?" _Verbatim: "?"_

Referenced ticket: [FOOBAR|https://example.com]

(The ticket description issue has been split off into SE-XXX)

The org output from ejira is split into two parts:

Referenced ticket: [FOOBAR|https://foobar.website]]

(The ticket description issue has been split off into SE-XXX)



@nyyManni Email me if you want to take a look at the full org output. I can't anonymize the whole file due to sheer size, but I'm happy to share more privately if it proves helpful for fixing this issue.
chaorace commented 4 years ago

Pushed a PR that should resolve this issue, I no longer experience the weird splitting after starting with a fresh file.

@kat-co @MadEarl Can you folks test the new PR branch #22 and check if the issue is clear on your end as well? Keep in mind that you'll need to clear out the project org file and start fresh to see a difference.

MadEarl commented 4 years ago

Fixes the biggest problem, org markup is no longer broken after update. I think I found a corner case where the square brackets are not correct yet, but have to confirm that. It's in any case a big improvement.

vlcek commented 3 years ago

I had also similar issue caused by "confused" parser and the patch in PR fixed it for me.

Will the PR get merged anytime soon please? :)