# Internal comments sync

**URL:** <https://community.exalate.com/t/internal-comments-sync/4315>\
**Category:** General Questions\
**Tags:** cloud-jira, comments, migrated\_question\
**Created:** [November 4, 2024, 6:47am UTC](https://community.exalate.com/t/internal-comments-sync/4315 "2024-11-04T06:47:20Z")\
**Posts on this page:** 3\
**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, 6:47am UTC](https://community.exalate.com/t/internal-comments-sync/4315/1 "2024-11-04T06:47:20Z")

</div>

_Originally asked by Kiet Ngo on 19 August 2020 [(original question)](https://oldcommunity.exalate.com/questions/11341527)_

* * *

Hi,

I have two instances which sync issues between, the connection is triggered by workflow post-function.

Let’s say instance #1, and instance #2.

The rules are same for both, we dont want to sync internal comments, only external comments.  
When issue created from #1 and sync to #2, everything is working properly.  
When issue created from #2 and sync to #1, internal comments from #2 are not synced to #1 which is correct, but internal comments from #1 are still synced to #2 which is not correct.

Please advise how to solve this issue.

Regards,

Kiet

* * *

---

<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, 6:47am UTC](https://community.exalate.com/t/internal-comments-sync/4315/2 "2024-11-04T06:47:22Z")

</div>

_Answer by Kiet Ngo on 19 August 2020_

Outgoing sync

```auto
replica.key = issue.key
replica.type = issue.type 
replica.assignee = issue.assignee 
replica.reporter = issue.reporter
replica.summary = issue.summary
replica.description = issue.description
replica.labels = issue.labels
replica.comments = issue.comments.findAll { !it.internal }
...

```

Incoming sync

```auto
if(firstSync){
   // If it's the first sync for an issue (local issue does not exist yet)
   // Set project key from source issue, if not found set a default
   issue.projectKey = "TGT"
   // Set type name from source issue, if not found set a default
   issue.typeName = "Incident"
}
issue.summary = replica.summary
issue.description = replica.description
issue.labels = replica.labels
issue.comments = commentHelper.mergeComments(issue, replica)
...

```

Rules are same for both instances.

* * *

#### Comments:

> **Francis Martens (Exalate) commented on 19 August 2020**
>
> > Can you share your rule set?

> **Kiet Ngo commented on 20 August 2020**
>
> > Francis Martens (Exalate) Hi, do you have any updates?

> **Francis Martens (Exalate) commented on 20 August 2020**
>
> > To set the expectations - Community gets attention if time allows.
> 
> Is the outgoing sync you provided the one of Jira #1 or Jira #2?
> 
> Can you provide the incoming, outgoing sync of both ends and label it accordingly?

> **Kiet Ngo commented on 20 August 2020**
>
> > **Jira #1** TGT [https://cevalogistics.atlassian.net/](https://cevalogistics.atlassian.net/)  
> > Outgoing sync
> 
> ```auto
> replica.key = issue.key
> replica.type = issue.type 
> replica.assignee = issue.assignee 
> replica.reporter = issue.reporter
> replica.summary = issue.summary
> replica.description = issue.description
> replica.labels = issue.labels
> replica.comments = issue.comments.findAll { !it.internal }
> replica.resolution = issue.resolution
> replica.status = issue.status
> replica.parentId = issue.parentId
> replica.priority = issue.priority
> replica.attachments = issue.attachments
> replica.project = issue.project
> 
> //Comment these lines out if you are interested in sending the full list of versions and components of the source project.
> replica.project.versions = []
> replica.project.components = []
> 
> /*
> Custom Fields
> */
> ...
> 
> ```
> 
> Incoming sync
> 
> ```auto
> if(firstSync){
> // If it's the first sync for an issue (local issue does not exist yet)
> // Set project key from source issue, if not found set a default
> issue.projectKey = "TGT"
> // Set type name from source issue, if not found set a default
> issue.typeName = "Incident"
> }
> issue.summary = replica.summary
> issue.description = replica.description
> issue.labels = replica.labels
> issue.comments = commentHelper.mergeComments(issue, replica)
> ...
> 
> ```
> 
> **JIRA #2** IRL [https://t9275.atlassian.net/](https://t9275.atlassian.net/)
> 
> Outgoing sync
> 
> ```auto
> replica.key = issue.key
> replica.type = issue.type 
> replica.assignee = issue.assignee 
> replica.reporter = issue.reporter
> replica.summary = issue.summary
> replica.description = issue.description
> replica.labels = issue.labels
> replica.comments = issue.comments.findAll { !it.internal }
> replica.resolution = issue.resolution
> replica.status = issue.status
> replica.parentId = issue.parentId
> replica.priority = issue.priority
> replica.attachments = issue.attachments
> replica.project = issue.project
> 
> //Comment these lines out if you are interested in sending the full list of versions and components of the source project.
> replica.project.versions = []
> replica.project.components = []
> 
> /*
> Custom Fields
> 
> replica.customFields."CF Name" = issue.customFields."CF Name"
> */
> 
> ```
> 
> Incoming sync
> 
> ```auto
> if(firstSync){
> // If it's the first sync for an issue (local issue does not exist yet)
> // Set project key from source issue, if not found set a default
> issue.projectKey = "IRL"
> // Set type name from source issue, if not found set a default
> issue.typeName = "Incident"
> issue.customFields."Request Type".value = "Operational Issue"
> }
> issue.summary = replica.summary
> issue.description = replica.description
> issue.labels = replica.labels
> issue.comments = commentHelper.mergeComments(issue, replica)
> issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
> ...
> 
> ```
> 
> Francis Martens (Exalate) updated outgoing/incoming sync rules for both instances.

> **Francis Martens (Exalate) commented on 20 August 2020**
>
> > Are both Jira Service Desk or is there a combination Jira Service Desk / Jira Software

> **Kiet Ngo commented on 20 August 2020**
>
> > They are both Jira service desk

> **Francis Martens (Exalate) commented on 21 August 2020**
>
> > Further trying to understand
> 
> So when an issue is created in #1 and exalated to #2, internal comments are not synced.
> 
> But when the issue is created in #2 and exalated to #1, internal comments from #1 are being synced
> 
> This is strange because it is using the same outgoing sync.  
> Is the customer request type set on issue #1 which has been exalated? Just a hunch

> **Kiet Ngo commented on 22 August 2020**
>
> > This is strange for me as well. Customer request type on both issues are set.

> **Francis Martens (Exalate) commented on 23 August 2020**
>
> > Can you check the incoming sync on #1.
> 
> ```auto
> if(firstSync){
> // If it's the first sync for an issue (local issue does not exist yet)
> // Set project key from source issue, if not found set a default
> issue.projectKey = "TGT"
> // Set type name from source issue, if not found set a default
> issue.typeName = "Incident"
> }
> ...
> 
> ```
> 
> The ‘request type’ is not set (while it is on the incoming sync of #2)

> **Kiet Ngo commented on 23 August 2020**
>
> > You’re correct. After changed the script to set Request Type it works properly. Thanks for your support Francis Martens (Exalate) !

> **Francis Martens (Exalate) commented on 23 August 2020**
>
> > Please mark the answer correct _(old community)_
> 
> It is helpful for other exalate users.

> **David Loszewski commented on 12 May 2022**
>
> > Could someone tell me how you would differentiate between the incoming sync and outgoing sync script? Where would you place them? When I go to Exalate→Connections, the script is the same for both the incoming and outgoing.

> **Francis Martens (Exalate) commented on 13 May 2022**
>
> > Hi David Loszewski
> 
> Good question - assuming you have a scripted connection, you can distinguish  
> ![](https://dub1.discourse-cdn.com/flex018/download/thumbnails/11341527/image2022-5-13_8-44-54.png?version=1&modificationDate=1652424294486&api=v2)
> 
> If your view is different - can you post a screenshot.

> **Francis Martens (Exalate) commented on 13 May 2022**
>
> > Also, if you are in doubt how Exalate works - check the explainer video

---

<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 6, 2024, 6:47am UTC](https://community.exalate.com/t/internal-comments-sync/4315/3 "2024-11-06T06:47:27Z")

</div>

Closed on November 6, 2024, 6:47am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
