Comment updates are not working (commentHelper.includeInternalComments not available)

Hello,

I am reaching out to you in connection with support case EASE-51083 and require assistance with a specific issue:

I am encountering a problem with the commentHelper.mergeComments(issue, replica) function:

  1. The creation of new comments (both internal and public) is working as expected.

  2. However, as soon as I use the commentHelper.mergeComments function and edit a comment within a Jira Service Management project, these changes are not synchronized.

  3. While using issue.comments=replica.comments does work, it prevents me from making necessary adjustments to the comments.

  4. When I check the “Entity Sync status” on the target JSM instance, I see that the modified comments are indeed arriving in the Remote Replica; therefore, in my opinion, the problem lies solely in the target system.

  5. Support recommended setting the following variable to synchronize internal comments: commentHelper.includeInternalComments = true
    Unfortunately, however, I am receiving the following error:
    Error Detail Message:
    No such property: includeInternalComments for class: com.exalate.hubobject.jira.CommentHelper
    Error line: 43
    com.exalate.api.exception.script.ScriptException: No such property: includeInternalComments for class: com.exalate.hubobject.jira.CommentHelper at com.exalate.error.services.ScriptExceptionCategoryService.categorizeProcessorAndIssueTrackerExceptionsIntoScriptExceptions(ScriptExceptionCategoryService.scala:51) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:77) at

Best regards,
Felix

Hi @Felix-PCG ,

Welcome to the Exalate Community Portal.

I have tested out between Jira Software and JSM projects. The EDITED comments are synchronising successfully with the default code lines. I.e,

//Outgoing
replica.attachments    = issue.attachments
//Incoming
issue.comments     = commentHelper.mergeComments(issue, replica)

Since this is not working for you, so could you please try out the following snippet into your Outgoing Sync rule, and keep the code line as default within the Incoming Sync rule.

(It has also worked for me)

//replica.attachments    = issue.attachments (Comment out this default line)
def updatedComments = []
replica.comments.each { remoteComment ->
    def localComment = issue.comments.find { it.id == remoteComment.id }
    if (localComment && localComment.body != remoteComment.body) {
        // Remove old comment (if possible)
        // Add new comment with updated body
        updatedComments << remoteComment
    } else if (!localComment) {
        // New comment, just add
        updatedComments << remoteComment
    }
}
issue.comments = updatedComments

On the other hand, I would also recommend to check the Permission for ‘Exalate’ proxyuser or you can also try adding it manually, then try out with the default code lines as well.

  1. Go to Permission Schemes
  2. Scroll down to ‘Comments Permissions’ section
  3. Click ‘Update’ for ‘Edit All Comments’ option
  4. Select ‘Single user’ option
  5. Type ‘Exalate’ to select the ProxyUser
  6. Click ‘Update’
  7. Try editing the Comments

Note: Please do the same for ‘Edit Own Comments’ permission type.

And, if this does not work. Please let me know if you’re using JSM on both sides or is it a different Project type on one side?

Looking forward to your update here.

--
Kind regards,
Ashar

Hi Ashar,

Thank you very much for your detailed response. We are connecting a client’s Jira Service Management Cloud instance with our own Jira Service Management Cloud instance.

Over the past few days, I have conducted extensive testing using the adjustments you suggested.

Unfortunately, issue.comments = commentHelper.mergeComments(issue, replica) is still failing to handle comment updates originating in the source system. While the updates are visible in the Remote Replica (accessed from the target system), they are not being imported into the ticket itself.

I also spent several hours attempting to get the alternative method listed below it working, but I was unable to get it running completely successfully. Although it did transfer updates, it also resulted in the deletion of internal comments.

I also checked the permissions, but this likewise made no difference.

Kind Regards
Felix