How to keep code block formatting the same in comments from Jira Cloud to Zendesk?

Originally asked by Mathieu Lepoutre on 05 July 2022 (original question)


Sending over comments with codeblocks, will put tags before and after the contents of the codeblocks. How can I remove them?


Answer by Mathieu Lepoutre on 05 July 2022

Both Zendesk and Jira Cloud send their data in Markdown.

Jira Cloud Outgoing Sync:

replica.comments       = issue.comments

Zendesk Incoming Sync:

def string = replica.addedComments.last().body
def str2 = string.replaceAll('\\{noformat\\}','\n```\n')
issue.comments += commentHelper.addComment("${str2}", issue.comments).collect{it.internal = false; it}

This will put the comments as public replies. Changing the internal to true will put them as internal replies.


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.