Reporter's comments are being synced as "Exalate"

Originally asked by David Loszewski on 18 April 2022 (original question)


Hello,

I’m having an issue where the public comments are being sync’d as “Exalate” instead of the actual user of the comment. I have made sure that the user exists in the companies. Exalate support suggested I used scripts instead of the visual method. I have attempted this however am still showing the commenter as Exalate. Any help would be appreciated.


[Failed to download attachment: attachment_42836849_image%20%283%29.png. Error: 404 Client Error: for url: https://community.exalate.com/download/attachments/42836846/image%20(3).png?version=1&modificationDate=1650302912909&api=v2]

[Failed to download attachment: attachment_42836849_image%20%282%29.png. Error: 404 Client Error: for url: https://community.exalate.com/download/attachments/42836846/image%20(2).png?version=1&modificationDate=1650302888015&api=v2]

Comments:

Ariel Aguilar commented on 18 April 2022

Hi there,

You need to delete the comments mapping and just add the following script where A and B stand for your connection short name (For example, in this case connection name is A_to_B):

if (executionInstanceName == "A") {
    replica.getClass().fields
    def locked = replica.getClass().declaredFields.find{it.name == "_locked"}
    locked.setAccessible(true)
    locked.set(replica, false)
    replica.addedComments.each { it.executor = nodeHelper.getUserByEmail(it.author?.email) }
    replica.changedComments.each { it.executor = nodeHelper.getUserByEmail(it.updateAuthor?.email) }
    issue.comments = commentHelper.mergeComments(issue, replica, { it }) 
}

if (executionInstanceName == "B") {
    replica.getClass().fields
    def locked = replica.getClass().declaredFields.find{it.name == "_locked"}
    locked.setAccessible(true)
    locked.set(replica, false)
    replica.addedComments.each { it.executor = nodeHelper.getUserByEmail(it.author?.email) }
    replica.changedComments.each { it.executor = nodeHelper.getUserByEmail(it.updateAuthor?.email) }
    issue.comments = commentHelper.mergeComments(issue, replica, { it })
}

Kind regards,

Ariel

David Loszewski commented on 18 April 2022

This seems to have worked, I’ll continue to monitor. Thank you very much!

David Loszewski commented on 19 April 2022

Looks to not be working still. Still showing up as Exalate and not seeing any errors. Here’s the latest from the jcloudnode.log file, not sure if it helps:

“issueKey”:{“id”:21694,“idStr”:“21694”,“urn”:“CTS-2113”,“entityType”:“issue”}},“connectIssueUrn”:null,“unexalateRemoteIssueUrn”:null,“deletedRemoteIssueUrn”:null,“syncedTo”:{“id”:13783,“idStr”:“13783”,“urn”:“CTS-2658”,“entityType”:“issue”},“blobMetadataList”:,“twinTraceId”:1592,“payed”:false,“subscriptionContext”:{“withNodeSubscription”:true,“withExalateSubscription”:false},“connectContext”:null,“traces”:[{“type”:“COMMENT”,“localId”:“35258”,“remoteId”:“14008”,“action”:“NONE”,“toSynchronize”:true},{“type”:“COMMENT”,“localId”:“35259”,“remoteId”:“14009”,“action”:“NONE”,“toSynchronize”:true},{“type”:“COMMENT”,“localId”:“35260”,“remoteId”:“14010”,“action”:“NONE”,“toSynchronize”:true},{“type”:“COMMENT”,“localId”:“35261”,“remoteId”:“14011”,“action”:“NONE”,“toSynchronize”:true}],“syncType”:“UPDATE”}

Ariel Aguilar commented on 20 April 2022

Hi David,

This post says you are referring to Jira Cloud, is this connection between 2 Jira Cloud and the user has the same email address on both instances?

Kind regards,

Ariel

David Loszewski commented on 20 April 2022

Hi Ariel Aguilar , yes, two Jira cloud instances, the user has the same email address on both instances.

Ariel Aguilar commented on 20 April 2022

Could you verify the lines and it’s spacing? I just made an adjustment to the code block above. It’s important the lines are complete sentences and not to be separated.

David Loszewski commented on 21 April 2022

I copy and pasted from the code block above although I don’t see any changes from what you previously posted.