How to Convert Data between HTML and Markdown in Jira Cloud

    During a sync, Jira Cloud sends data in Markdown and Azure DevOps sends data in HTML. Due to format differences, some formatting errors for text, images, lists, tables, links, and comments might appear after the sync. You can use Exalate scripts to prevent this.

    Note: This method is an alternative to using stripHtml in Exalate for Azure DevOps. We recommend using this method over stripHtml when syncing Azure DevOps and Jira Cloud.

    Jira Cloud

    Outgoing Sync

    You can use the following scripts to convert the data from Markdown to HTML:

    1 replica.description = nodeHelper.getHtmlField(issue, "description")
    2 replica.comments = nodeHelper.getHtmlComments(issue)

    Parameters

    Parameter Description
    nodeHelper.getHtmlField(issue, "description") Converts issue fields from Markdown to HTML. You can enter an issue field you want to sync instead of "description"

    nodeHelper.getHtmlComments(issue)

    nodeHelper.getHtmlComments(issue)

    Converts comments from Markdown to HTML

    Incoming Sync

    The following code is used to convert the incoming data from HTML to Markdown:

    1 issue.description  = nodeHelper.toMarkDownFromHtml(replica.description)
    2 issue.comments     = nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica))

    Parameters

    Parameter Description

    nodeHelper.toMarkDownFromHtml(replica.description)

    nodeHelper.toMarkDownFromHtml(replica.description)

    Converts issue fields from HTML to Markdown

    nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica))

    nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica))

    Converts comments from HTML to Markdown

    Have more questions? Ask the community