Text formatting issue GitHub to Jira Cloud

Creating this on behalf of @jcotant

I’m having text formatting issues in the description field from GitHub to Jira Cloud.

GitHub

Jira Cloud

I have tried several methods from the nodeHelper object, including stripHtml and getHtmlField in GitHub, and toMarkDownFromHtml in Jira Cloud. I also tried using replaceAll to replace all the newline characters, but had no success. Is there a workaround for this formatting issue?

Hi @jcotant

Wanted to let you know that I’m working on this and will be providing an update soon.

Best,
Kevin

Awesome to hear – thanks, Kevin!

Best,
Joe

Hi @jcotant

Apologies for the delay.

Both tracker are using Markdown, So there is no need to user any helper. You should get the majority of formatting ok by using

GitHub Outgoing:
replica.description = issue.description

Jcloud incoming:
issue.description = replica.description

That being said, GitHub is using GFM (GitHub Flavored Markdown) which has some differences with the vainilla one used by JCLOUD.

I am currently looking if there way to specify the changes to avoid having stranger formatting when syncing from GitHub to Jcloud.

Best,
Kevin

Thanks so much for the work here, Kevin! Previously we tried the same configuration as you suggested and were still hitting the formatting issues, so perhaps it has to do with the GitHub Flavored Markdown. Let me know if there’s any further info or details I can provide that would help.

Best,

Joe

Hi Kevin,

Hope this finds you well. Just checking in to see if there’s been any other progress on this issue?

Thanks!
Joe

Hi @jcotant

Apologies on the delay.

After testing several different approaches.

I believe that the one that will work best for this case is the following:

Outgoing sync GitHub:

replica.description = nodeHelper.getHtmlField(issue.description)

Incoming sync Jira Cloud:

issue.description = nodeHelper.toMarkDownFromHtml(replica.description)

This is working well on my instance, however the are going to be some small differences. But the format is the correct one.

Hi Kevin,

Thanks so much for staying on top of this one! I’m doing some testing today and will let you know how things go.

Best,
Joe

Hi Kevin,

Happy to report that your solution works wonderfully! We’re very appreciative of the effort here.

We’ll continue to monitor for any small differences, but we haven’t come across any yet.

Thanks again!
Joe

We are facing a similar issue so this thread has been very helpful, thank you

After implementing this solution, indeed the description looks better in Jira at first but on the next sync from Jira to Github, the description is being updated again and we are looking the original formatting

Are you seeing a similar behavior ?

Hi @Damien_Garros

Please correct me if im wrong, but I understand that the formatting is showing properly on the first time but as soon as there is update it changes back.

If this is is the case, could you please share with me the your incoming sync on Github? (assuming that the formatting issues on GitHub).

Looking forward to your update.

Best,
Kevin

Hi @Damien_Garros

Just following up on this topic, where you able solved it?

Something worth checking is to see if you are not managing the description on the first sync part and then again outside the first sync.

Because, if you fixed the description (changing the formatting) inside the first sync block but you have the old line outside the first sync block, Exalate will be using other formatting for every update.
Ex.

If (firstSync){
    issue.description = nodeHelper.toMarkDownFromHtml(replica.description)
}
//This block will only execute during the exalate event.


issue.description = replica.description
//This will execute every time there is an update, and will be overwrite the one on the firstSync block, modifying the format.

Looking forward to your update.

Best,
Kevin

Thank you for the follow up
I was able to fix the situation to only update the description during the first sync, it’s not perfect but at least we are impacting the public issue in Github

I‘ll try to do more test at some point but for now I think we are good

Hi @Damien_Garros

Thank you for the update!
Let me know if anything else comes up.

Best,
Kevin