# Synchronization of internal and external comments

**URL:** <https://community.exalate.com/t/synchronization-of-internal-and-external-comments/5026>\
**Category:** General Questions\
**Tags:** zendesk, servicenow-jira, zendesk-jira, migrated\_question\
**Created:** [November 4, 2024, 7:38am UTC](https://community.exalate.com/t/synchronization-of-internal-and-external-comments/5026 "2024-11-04T07:38:54Z")\
**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, 7:38am UTC](https://community.exalate.com/t/synchronization-of-internal-and-external-comments/5026/1 "2024-11-04T07:38:55Z")

</div>

_Originally asked by Fran Sánchez on 27 January 2022 [(original question)](https://oldcommunity.exalate.com/questions/42831616)_

* * *

How can I synchronize from Jira Service to Zendesk an internal comment as an internal comment, and a public comment as a public comment?

So far the only thing I know how to do is to pass all public and private comments from Jira as internal to Zendesk. How do I make that difference?

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, 7:38am UTC](https://community.exalate.com/t/synchronization-of-internal-and-external-comments/5026/2 "2024-11-04T07:38:56Z")

</div>

_Answer by Francis Martens (Exalate) on 27 January 2022_

Hi Fran Sánchez

Checkout the [How to manage comment visibility](https://docs.idalko.com/exalate/x/QQBL) document  
Just set the comment.internal to true or false.

(this is for scripted connections)

* * *

#### Comments:

> **Fran Sánchez commented on 27 January 2022**
>
> > Thank you very much for your reply.
> 
> Yes, I checked it, but I don’t see how to make the comparison to determine if what I get is an internal or external comment and then apply true or false to the attribute.
> 
> I have tried several things, but it does not work:
> 
> ```auto
> issue.comments = commentHelper.mergeComments(issue, replica, {
> comment ->
> if (replica.internal) {
> comment.internal = true
> }else{
> comment.internal = false       
> }
> comment
> }
> )
> 
> ```
> 
> Where is the error?
> 
> Best regards

> **Fran Sánchez commented on 27 January 2022**
>
> > any idea Francis Martens (Exalate)?? thanks for the help!!

> **Francis Martens (Exalate) commented on 27 January 2022**
>
> > It is always handy to know what the cause of the problem is.  
> > What you need to know is what the value of replica.internal is.
> 
> One way of doing so is to add in your code a debug statement which will raise an error showing the information you need to know
> 
> ```auto
> issue.comments = commentHelper.mergeComments(issue, replica, {
> comment ->
> 
> debug.error("The value of replica.internal is ${replica.internal}")
> if (replica.internal) {
> comment.internal = true
> }else{
> comment.internal = false       
> }
> comment
> }
> )
> 
> ```
> 
> And then trigger an incoming sync. And review the output of the debug statement …
> 
> I guess that replica.internal doesn’t exist.

> **Fran Sánchez commented on 27 January 2022**
>
> > Thank you very much for your response. I was unaware of the debugging option. It is perfect.
> 
> Once tested I confirm that indeed replica.internal is null. However I have debugged the replica.comments of the Jira outgoint sync and despite having public and private comments I see that everything comes out as public. So it is logical that Zendesk cannot differentiate between private and public.
> 
> Why is this? I attach the image in which you can see that I have in Jira public and private comments, the image of the lines that I am debugging and part of the debug result where you can see that all comments: @internal= `false`.
> 
> Outgoing sync in Jira:
> 
> ```auto
> replica.comments = issue.comments
> debug.error("The value of comments is ${replica.comments}")
> 
> ```
> 
> Comments private and public in Jira:
> 
> ![](https://dub1.discourse-cdn.com/flex018/download/attachments/42831616/image2022-1-27_16-9-55.png?version=1&modificationDate=1643296195799&api=v2)
> 
> Result of the debug:
> 
> ```auto
> BasicHubComment{@body=`new12`, @id=`10229`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 08:56:21 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 08:56:21 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`newpublica`, @id=`10230`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 09:02:45 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 09:02:45 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`new interna`, @id=`10231`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 09:02:50 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 09:02:50 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}, BasicHubComment{@body=`responder al cliente`, @id=`10232`, @remoteId=`null`, @author=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @created=`Thu Jan 27 14:51:10 UTC 2022`, @updateAuthor=`{ @key : 70121:9c815981-e9a2-45bd-af56-2d60fee20b8a}`, @updated=`Thu Jan 27 14:51:10 UTC 2022`, @group=`null`, @role=`null`, @internal= `false`, @executor= `null`}
> 
> ```

> **Francis Martens (Exalate) commented on 27 January 2022**
>
> > The rest api of Jira reports all comments as public whenever the request type is not set …
> 
> Is the request type set on the JIra side?

> **Fran Sánchez commented on 27 January 2022**
>
> > ![](https://dub1.discourse-cdn.com/flex018/download/attachments/42831616/image2022-1-27_17-30-20.png?version=1&modificationDate=1643301021224&api=v2)
> 
> I thi think so, it’s the green icon next to the ticket ID, isn’t it? or am I wrong?

> **Fran Sánchez commented on 27 January 2022**
>
> > I think I have found the solution here. I will try it and confirm:
> 
> [https://community.atlassian.com/t5/Jira-Service-Management/Service-Desk-Request-Type-always-blank-when-issue-created-by/qaq-p/911928](https://community.atlassian.com/t5/Jira-Service-Management/Service-Desk-Request-Type-always-blank-when-issue-created-by/qaq-p/911928)
> 
> [https://confluence.atlassian.com/jirakb/customer-request-type-displays-no-match-in-jira-859463969.html](https://confluence.atlassian.com/jirakb/customer-request-type-displays-no-match-in-jira-859463969.html)

> **Francis Martens (Exalate) commented on 28 January 2022**
>
> > This is an example of a request type set
> 
> on Jira Server
> 
> ![](https://dub1.discourse-cdn.com/flex018/download/attachments/42831616/image2022-1-28_7-17-22.png?version=1&modificationDate=1643350642658&api=v2)
> 
> On Jira cloud
> 
> ![](https://dub1.discourse-cdn.com/flex018/download/attachments/42831616/image2022-1-28_7-18-29.png?version=1&modificationDate=1643350709491&api=v2)
> 
> Can you check and confirm

> **Fran Sánchez commented on 01 February 2022**
>
> > Hello, that was the problem. Once I assigned a request type to the tickets I have already been able to differentiate between public and internal comments later in Zendesk for what I needed. thank you very much for the help provided!
