Description sync as internal comment

Originally asked by Christos Katsivas on 25 January 2021 (original question)


When i create a Zendesk ticket through Jira, the description was adding as public comment. How can i sync the description as internal comment on Zendesk?

Thank you.


Answer by Ariel Aguilar on 25 January 2021

Hi Christos Katsivas,

The Zendesk API doesn’t allow for the description to be created as private, as a workaround, we suggest creating the Zendesk ticket with a default description, like “No description” and then treating the first comment after that as the real description, which can be set to internal. This can be accomplished with the following snippet of code on script:

if (firstSync) {
    issue.description = "No Description"
    def internalDescription = replica.description
    issue.comments = commentHelper.addComment(issue.comments) { comment ->
        comment.body = internalDescription
        comment.internal = true
    }
}

Kind regards,

Ariel