Status changed to “Closed” in Jira → status sent to all Zendesk tickets linked to the closed Jira → Public reply added the corresponding ZD tickets “Hi your bug has been fixed” → Close all corresponding ZD tickets.
First in the Incoming Sync make sure you are mapping the correct status:
def statusMap = [
// “remote status name”: “local status name”
“Done” : “Closed”,
def remoteStatusName = replica.status.name
issue.setStatus(statusMap[remoteStatusName] ?: “To Do”) >> This will set a default status if the ones above are not found
Them set a comment to be created based on the replica.status.name coming from the remote node that matches the close status in your receiving instance.
if (replica.status.name == “Done”) {
issue.comments = commentHelper.addComment(“Hi your bug has been fixed”, issue.comments)
} else {
issue.comments = commentHelper.mergeComments(issue, replica)
}