Updating comments doesn't put comments under sync (Jira DC → Jira Cloud)

Hi,
We have a sync between Jira DC v10.3.6(Exalate v. 5.27.0) and Jira Cloud(+ docker node instance v. 5.22.0).
I’m experiencing an issue where updating a comment on the Jira DC side does not update the comment on the Jira Cloud side(Jira DC → Jira Cloud). The sync in backward direction update comments as expected(Jira Cloud→ Jira DC).
The sync is being triggered as expected. I added logging in the incoming sync script on Jira Cloud, and I can see that the replica.comments field contains the updated comment, but replica.changedComments is empty https://docs.exalate.com/docs/jira-fields-and-entities-available-for-synchronization

Below are the incoming Jira Cloud sync script and logs:

outgoing":

replica.comments = issue.comments

incoming:

issue.comments = commentHelper.mergeComments(issue, replica)
replica.comments.each { c ->
log.info("replica comments:==>" + c.id +" Comment updated = " + c.updated + " | created = " + c.created + " | body = " + c.body)
}
issue.comments.each { c ->
log.info("issue comments:==>" + c.id +" Comment updated = " + c.updated + " | created = " + c.created + " | body = " + c.body)
}
replica.changedComments.each { c ->
log.info("replica changedComments==>" + c.id +" Comment updated = " + c.updated + " | created = " + c.created + " | body = " + c.body)
}

log output from Jira Cloud:

2025-08-06 16:02:06,319 [INFO] from application.services.replication.PollSchedulerService in application-akka.actor.default-dispatcher-9 - PollSchedulerService is checking whether a schedule exists for the connection with id `11`
2025-08-06 16:02:27,826 [INFO] from application.controllers.handlers.SyncRequestHandler in application-akka.actor.default-dispatcher-6 - Received a sync request for sync event id `11834` with number `13`
2025-08-06 16:02:27,916 [INFO] from application.services.replication.request.RequestSchedulerService in application-akka.actor.default-dispatcher-6 - Creating a sync request and context for remote event id 11834 and connection 'TEST'
2025-08-06 16:02:28,061 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-11 - Processing request 3332 of type `UPDATE`, on state READY for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:02:28,994 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-8 - Processing request 3332 of type `UPDATE`, on state UPDATE_ISSUE for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:02:30,889 [INFO] from com.exalate.replication.services.processor.ChangeIssueProcessor in application-akka.actor.default-dispatcher-8 - replica comments:==>183373 Comment updated = 2025-08-06 13:15:15.321 | created = 2025-08-06 12:44:06.624 | body = test23456
2025-08-06 16:02:30,889 [INFO] from com.exalate.replication.services.processor.ChangeIssueProcessor in application-akka.actor.default-dispatcher-8 - replica comments:==>183384 Comment updated = 2025-08-06 16:02:16.239 | created = 2025-08-06 15:21:15.54 | body = new comment TEST 123
2025-08-06 16:02:30,892 [INFO] from com.exalate.replication.services.processor.ChangeIssueProcessor in application-akka.actor.default-dispatcher-8 - issue comments:==>183373 Comment updated = Wed Aug 06 12:44:22 UTC 2025 | created = Wed Aug 06 12:44:22 UTC 2025 | body = User1 commented: test
2025-08-06 16:02:30,892 [INFO] from com.exalate.replication.services.processor.ChangeIssueProcessor in application-akka.actor.default-dispatcher-8 - issue comments:==>183384 Comment updated = Wed Aug 06 15:21:28 UTC 2025 | created = Wed Aug 06 15:21:28 UTC 2025 | body = User1 commented: new comment
2025-08-06 16:02:31,076 [WARN] from jcloudnode.services.jcloud.hubobjects.JCloudJsonToHubObjectConversionService in application-akka.actor.default-dispatcher-11 - Did not execute getEmailByAccountIdBulk for userAccountIds, as userAccountIds is empty List()
2025-08-06 16:02:31,292 [WARN] from jcloudnode.services.jcloud.hubobjects.JCloudJsonToHubObjectConversionService in application-akka.actor.default-dispatcher-6 - Did not execute getEmailByAccountIdBulk for userAccountIds, as userAccountIds is empty List()
2025-08-06 16:02:31,294 [DEBUG] from jcloudnode.services.jcloud.hubobjects.JCloudHubObjectToJsonConversionService in application-akka.actor.default-dispatcher-8 - #toJson converting for issue CLOUDTEST-72: Some({"fields":{"customfield_10058":["test-service-name"]}})
2025-08-06 16:02:31,294 [DEBUG] from jcloudnode.services.jcloud.hubobjects.JCloudHubObjectToJsonConversionService in application-akka.actor.default-dispatcher-8 - #getUpdateValue No update value
2025-08-06 16:02:31,618 [DEBUG] from jcloudnode.services.jcloud.transport.JCloudClient in application-akka.actor.default-dispatcher-8 - CLOUD updating issue 'CLOUDTEST-72' with id '617594'
with json body: {"fields":{"customfield_10058":["test"]}}

2025-08-06 16:02:32,308 [INFO] from jcloudnode.services.jcloud.IssueService in application-akka.actor.default-dispatcher-6 - Adding 0 attachment/s to issue with id `617594` for twinTrace Some(1805)
2025-08-06 16:02:32,433 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-6 - Processing request 3332 of type `UPDATE`, on state CREATE_REPLICA for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:02:32,492 [INFO] from application.services.replication.request.CreateReplicaSyncRequestState in application-akka.actor.default-dispatcher-6 - #transitioning request `3332` for remote issue `TEST-273`: creating a replica for the issue `BasicIssueKey{@id=`617594`, @urn=`CLOUDTEST-72`, @fieldValues=`{}`, @entityType=`issue`}`
2025-08-06 16:02:33,440 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-6 - Processing request 3332 of type `UPDATE`, on state CREATE_OR_UPDATE_TWINTRACE for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:02:33,446 [INFO] from application.services.replication.request.CreateOrUpdateTwinTraceSyncRequestState in application-akka.actor.default-dispatcher-6 - #transitioning request `3332` for remote issue `TEST-273`: updating the twin trace 1805
2025-08-06 16:02:33,535 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-6 - Processing request 3332 of type `UPDATE`, on state SEND_RESPONSE for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:03:09,240 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-8 - Processing request 3332 of type `UPDATE`, on state RESPONSE_SENT for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:03:09,321 [INFO] from application.services.replication.request.RequestProcessorService in application-akka.actor.default-dispatcher-8 - Processing request 3332 of type `UPDATE`, on state COMPLETE for remote event `11834` number `13` for remote issue urn `TEST-273` using connection `TEST` and remote twin trace id Some(116287)
2025-08-06 16:03:09,334 [INFO] from application.services.replication.CleanUpService in application-akka.actor.default-dispatcher-8 - #transition: cleaning up and deleting the syncRequest with id 3332 for the remote event `11834` and connection `11'

We’ve tested editing delays ranging from a few seconds to several hours, and the result is always the same: updated comments are not synced to Jira Cloud.
You can notice a difference in comments body and date formats here:

replica comments:==>183373 Comment updated = 2025-08-06 13:15:15.321 | created = 2025-08-06 12:44:06.624 | body = test23456

issue comments:==>183373 Comment updated = Wed Aug 06 12:44:22 UTC 2025 | created = Wed Aug 06 12:44:22 UTC 2025 | body = User1 commented: test

Do I need to modify the date format somewhere?

Could this be related to some missing configuration on our Docker-based Exalate node (Cloud side)?

At least one post exists that describes similar behavior: https://community.exalate.com/t/sync-edited-comments-jira-jira/6224

Hi and welcome to the Exalate Community!

Thanks for sharing your question or insight, we appreciate your contribution.

A member of the Exalate team or community will review this post and respond as soon as possible.

In the meantime, feel free to explore related topics or join other conversations. We’re glad to have you here!

hi @Tomas_Lalanne,

the provided scripts doesn’t sync comments at all.

Hi @Sergey !

My apologies, for some reason the code didn’t get fully pasted

I have edited the comment with the script

BR

Tomas

Here the script:

Jira On prem Outgoing:

//For comments sync
replica.comments       = issue.comments

def getPreviousJson = {
def ttRepo = (nodeHelper).twinTraceRepository
//    com.exalate.persistence.twintrace.TwinTraceRepository ttRepo = ((com.exalate.node.hubobject.v1_3.NodeHelper)nodeHelper).twinTraceRepository
    def tt = ttRepo.getTwinTraceByLocalIssueKey(connection, issueKey)
//com.exalate.api.domain.twintrace.ITwinTrace tt = orNull(ttOpt)
    def lr = tt?.localReplica
     !lr ? null : ({
         def js = new groovy.json.JsonSlurper()
         def previousPayload = js.parseText(lr.payload)
         ["json":previousPayload.hubIssue, "validOn": new Date(lr.validOn.timeMillis)]
     })()
 }
//def previous = getPreviousJson()
 Map<String, Object> previous = getPreviousJson()?.json

 Map previousComments=[:]
for(Map comment:previous?.comments){
    previousComments.put(comment.get("id"),comment.get("body"))
}
Map changedComments=[:]
for (def c:issue.comments){
    def commentBody=previousComments.get(c.getIdStr())
    if(commentBody){
        if(c.getBody()!=commentBody)
        {
            changedComments.put(c.getIdStr(),c.getBody())
        }
    }
}
if(changedComments.size()>0){
    replica.customKeys."changedComments"=changedComments
}

For Jira Cloud:

if(replica.customKeys."changedComments"){
  Map remoteChangedComments=replica.customKeys."changedComments"
  Map allComments=[:]
  for(def com:replica.comments){
    allComments.put(com.getRemoteIdStr(),com)
  }

for(def changeComment:replica.changedComments){
  def remoteId=changeComment.getRemoteIdStr()
  if(remoteChangedComments.get(remoteId)){
    def remoteBody=remoteChangedComments.get(remoteId)
    def body=changeComment.getBody()
   if(body!=remoteBody)
   {
     changeComment.setBody(remoteBody)
   }
   remoteChangedComments.remove(remoteId)
  }
}
remoteChangedComments.each { entry ->
//def newChangedComment=com.exalate.basic.domain.hubobject.v1.BasicHubComment()
def newChangedComment=allComments.get(entry.key)
if(newChangedComment)
{
  newChangedComment.setBody(entry.value)
  replica.changedComments.add(newChangedComment)
}
 
}}issue.comments   = commentHelper.mergeComments(issue, replica)

hi @Tomas_Lalanne ,

Even after the updates, the scripts still aren’t syncing comments

BR,

Sergey

Hi @Sergey

Is there any error you are facing while syncing the comments or it is just not editing the comment?

Thanks,

Sonal

Now we have v. 5.27.0 on both sides, but the shared script is still not working.

Hi @Sergey

Then for this matter I recommend you opening a support ticket as it worked for the rest of the customers but you might be encountering another problem

BR

Tomas