# Add comment in service desk ticket based on restriction in jira software issue

**URL:** <https://community.exalate.com/t/add-comment-in-service-desk-ticket-based-on-restriction-in-jira-software-issue/6136>\
**Category:** General Questions\
**Created:** [January 20, 2025, 5:17am UTC](https://community.exalate.com/t/add-comment-in-service-desk-ticket-based-on-restriction-in-jira-software-issue/6136 "2025-01-20T05:17:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_Mayur](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/k_mayur/32/439_2.png) [@K\_Mayur](https://community.exalate.com/u/K_Mayur)\
**Post date:** [January 20, 2025, 5:17am UTC](https://community.exalate.com/t/add-comment-in-service-desk-ticket-based-on-restriction-in-jira-software-issue/6136/1 "2025-01-20T05:17:54Z")

</div>

I need help on a script that can be used in exalate plugin to check if a comment is added with a restriction in jira software issue then it should add as internal note on synced service desk ticket and if it is added without any restrictions then it should be added as a customer comment in synced service desk ticket.  
This is required for Jira cloud and not Jira On Premises

Regards,  
Mayuresh

---

<div class="post-metadata">

**Author:** ![K\_Mayur](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/k_mayur/32/439_2.png) [@K\_Mayur](https://community.exalate.com/u/K_Mayur)\
**Post date:** [January 20, 2025, 5:20am UTC](https://community.exalate.com/t/add-comment-in-service-desk-ticket-based-on-restriction-in-jira-software-issue/6136/2 "2025-01-20T05:20:24Z")

</div>

I tried this script but it is not working :-  
if (!firstSync && replica.projectKey == issue.projectKey){  
issue.comments = commentHelper.mergeComments(issue, replica, {  
comment →   
comment.executor = nodeHelper.getUserByEmail(comment.author?.email)  
comment.body = comment.author.displayName + " commented: " + comment.body + “\n”  
if (comment.role != “Engineer”){  
comment.internal = true}  
else{comment}  
})  
}

---

<div class="post-metadata">

**Author:** ![Majid](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/majid/32/343_2.png) [@Majid](https://community.exalate.com/u/Majid)\
**Post date:** [March 22, 2025, 12:48pm UTC](https://community.exalate.com/t/add-comment-in-service-desk-ticket-based-on-restriction-in-jira-software-issue/6136/3 "2025-03-22T12:48:26Z")

</div>

There is a lot of things going on there. Can you please elaborate what piece is not working for you exactly i.e. recognizing that the comment is coming from Engineer role, or making the target comment internal. It would also be nice to see a sample of the replica to see how the comment payload is arriving.

Also, you say that the script is not working. Do you have any errors?

Thanks  
Majid
