# Setting Zendesk ticket status to Close with public reply

**URL:** <https://community.exalate.com/t/setting-zendesk-ticket-status-to-close-with-public-reply/5458>\
**Category:** General Questions\
**Tags:** zendesk-jira, migrated\_question\
**Created:** [November 4, 2024, 8:05am UTC](https://community.exalate.com/t/setting-zendesk-ticket-status-to-close-with-public-reply/5458 "2024-11-04T08:05:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:05am UTC](https://community.exalate.com/t/setting-zendesk-ticket-status-to-close-with-public-reply/5458/1 "2024-11-04T08:05:58Z")

</div>

_Originally asked by Timmy Summers on 04 April 2023 [(original question)](https://oldcommunity.exalate.com/questions/58500825)_

* * *

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.

Would this be possible?

thanks!

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:05am UTC](https://community.exalate.com/t/setting-zendesk-ticket-status-to-close-with-public-reply/5458/2 "2024-11-04T08:05:59Z")

</div>

_Answer by Dario on 24 April 2023_

Hello Timmy Summers

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](http://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](http://replica.status.name) == “Done”) {  
issue.comments = commentHelper.addComment(“Hi your bug has been fixed”, issue.comments)  
} else {  
issue.comments = commentHelper.mergeComments(issue, replica)  
}

Please let me know if this works for you, thanks!

* * *
