Help with formatting text in sync between ADO and Jira Cloud

Redirected from Exalate Support on behalf of Hanne. Asking the customer to upload the scripts:

We have set up a new Exalate connection between our Jira Cloud
("version":"1001.0.0-SNAPSHOT","versionNumbers":[1001,0,0],"deploymentType":"Cloud","buildNumber":100290)
and our customer’s ADO (Cloud v5.28.4, Core v5.28.4). The Jira Cloud projects are company-managed, and we are using Exalate version 4.1.19-AC.

We are experiencing issues with text formatting and the handling of attachments/pictures in comments and other fields. He suggested that I upload our scripts for review.

We would greatly appreciate your assistance with this.

It sounds like you’re running into common formatting challenges when syncing text, images, and attachments between Jira Cloud and Azure DevOps (ADO) using Exalate. This is due to Jira Cloud using Markdown and ADO using HTML, which can cause formatting issues for text, images, and comments. Here’s how you can address these issues in your sync scripts:

1. Text Formatting (Markdown ↔ HTML):

  • On the Jira Cloud side, you should convert Markdown to HTML when sending data, and convert HTML back to Markdown when receiving data.
  • Example for the Jira Cloud Outgoing Sync (to ADO):
    replica.description = nodeHelper.getHtmlField(issue, "description")
    replica.comments = nodeHelper.getHtmlComments(issue)
    
  • Example for the Jira Cloud Incoming Sync (from ADO):
    issue.description  = nodeHelper.toMarkDownFromHtml(replica.description)
    issue.comments     = nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica))
    
  • This approach helps maintain formatting for text, images, lists, tables, and links.
  • Full details: How to Convert Data between HTML and Markdown in Jira Cloud

2. Attachments and Images:

  • To sync attachments, use the following in your Outgoing Sync:
    replica.attachments = issue.attachments
    
  • And in your Incoming Sync:
    issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
    
  • You can filter or customize which attachments to sync (e.g., by file type or only those mentioned in comments).
  • More info: How to Sync Attachments in Jira Cloud

3. Comments:

  • For syncing comments, the default is to merge local and remote comments:
    issue.comments = commentHelper.mergeComments(issue, replica)
    
  • You can also filter or format comments as needed.
  • More info: How to Sync Comments in Jira Cloud

What to do next:

  • Review your current sync scripts and compare them with the examples above.
  • Make sure you’re using the conversion helpers for text formatting and the merge helpers for attachments and comments.
  • If you’re still seeing issues, feel free to share your current scripts (as suggested by support) for a more targeted review.

These adjustments should help resolve most formatting and attachment issues between Jira Cloud and ADO.

Hi, as far as I can see, Jira Cloud (company managed) uses ADF-rendering, not classic wiki. This complicates it. toMarkDownFromHtml doesn’t work.

Hi @Hanne ,

Thank you for sharing further details. I will work on this and update you back with a solution by tomorrow.

Kind regards,
Ashar

Hi @Hanne ,

Sorry for taking longer time than anticipated.

I’ve almost got the solution, and only inline image part is pending for ‘Repro steps’ field. I am currently working on this, and will share the solution soon.

In the meanwhile, could you please try this out?

Outgoing - Jira cloud:

replica.description = nodeHelper.getHtmlField(issue, “description”)
replica.comments = nodeHelper.getHtmlComments(issue)

Incoming - ADO:

workItem.summary      = replica.summary
// Map description to ReproSteps if Bug, else to description
if(workItem.typeName == "Bug") {
  workItem."Microsoft.VSTS.TCM.ReproSteps" = replica.description
} else {
  workItem.description = replica.description
}
workItem.attachments = attachmentHelper.mergeAttachments(workItem, replica)
workItem.comments = commentHelper.mergeComments(workItem, replica)

It should work for the text formatting in ‘Repro steps’ field, and text formatting as well as inline image in Comments on the ADO side.

I’ve followed this documentation: How to Convert Data between HTML and Markdown in Jira

Kind regards,
Ashar

@ashar.iqbal

Did you test this with ADF-rendering field as well?

Thanks,

Sonal

Hi @ashar.iqbal,
thanks for your response. We’ve managed to work around the issues with importing text and images from Jira to ADO, but we’re still experiencing problems when importing into Jira.
Thanks,
Hanne

Hi @Hanne ,

I am glad to know that you managed to workaround from Jira to ADO. Would you like to share the solution that has worked for you?

And may I please have some details about ‘problem’ you’re particularly experiencing when importing from ADO to Jira?

Looking at the Local replica and Remote replica from Jira and the code snippet would be helpful. You can copy it from ‘Entity Sync Status’ tab.

Kind regards,

Ashar

Hello @Hanne ,

Just checking in to see if you had a chance to gather the replicas and details I requested earlier?

Thank you,

Ashar

Hope you’re doing well, @Hanne . If you still require assistance, please share the previously requested details so we can proceed with the remaining part of the use case (from ADO to Jira).

Thank you,

Ashar

Hi @Hanne ,

Please let me know if you still need further assistance.

Thank you,

Ashar

Hi! we’ve had some tech difficulties, but I will have a new check tomorrow :slight_smile:

1 Like

Hi! No longer trouble with text formatting, now struggeling hard to show pictures in comments that are imported from ADO to Jira Cloud.

Hi @Hanne

Can you provide some more context? are you not able to see pictures in comments or there is some error ?

It would be good if you give some examples using screenshots.

Thanks,

Sonal

Hi :slight_smile: I’m encountering one of three issues:

  1. Non-unique image names from ADO:
    The output from ADO doesn’t generate a unique image name, which causes the wrong image to appear in the Jira comments.
    Attempted fix: I tried adding a unique suffix to the image name in outgoing from ADO.

  2. “Preview unavailable” issue in Jira:
    When using unique image names, the image is successfully transferred from ADO to Jira as an attachment, but it only shows as “Preview unavailable” in the comment.
    Attempted fix: I tried various adjustments, but the only other outcome was—

  3. Image not transferred at all:
    The image isn’t transferred from ADO; instead, only a link to the ADO image appears in the Jira comment.

We need to resolve this issue, but I’m running out of both time and options.
If anyone has example scripts (for outgoing from ADO and incoming to Jira Cloud) that handle safe image transfer, I’d really appreciate your help.

I’m specifically looking for a solution that ensures:

  • Images are transferred with unique file names

  • Images display correctly inline in both the description field and comments in Jira

  • Images are added to the list of attachments in Jira

  • The file name appears below the image in the comment, in case of any display errors

Any working examples, tips, or references would be a huge help.

This is how the comments looks like in ADO:

Showing in Jira:

  1. “preview unavailable”

3. as a link to the image in ADO:

Hi @Hanne

Can we have a small screen share session to resolve this? I will provide you the Calendly link where you can book the session. You will find the Calendly information in your “My Messages”.

Thanks,

Sonal

Hi @Hanne

I wanted to follow up—were you able to schedule a call with me by provided link in DM? Please let us know if you need any further assistance.

Thanks,

Sonal