How to Convert Data between HTML and Markdown in Zendesk

    During the sync, Zendesk sends data in Markdown and other nodes, such as Azure DevOps, could send 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 Zendesk.

    Zendesk

    Outgoing Sync

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

    replica.description = nodeHelper.getHtmlDescription(issue)
    replica.comments = nodeHelper.getHtmlComments(issue)

    Parameters

    Parameter Description
    nodeHelper.getHtmlDescription(issue) Converts ticket description from Markdown to HTML

    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:

    def includeComments = commentHelper.mergeComments(issue, replica).collect{it}
    issue.comments = nodeHelper.toMarkDownComments(includeComments)

    Parameters

    Parameter Description

    nodeHelper.toMarkDownFromHtml(replica.description)

    Converts ticket fields from HTML to Markdown
    nodeHelper.toMarkDownComments(commentHelper.mergeComments(issue, replica).collect{it})
    Converts comments from HTML to Markdown

    Have more questions? Ask the community