Can we send automatic comments to one side of the sync on specific exalate actions? for example, if the ticket gets assigned can we send an automatic comment to the other system?
There is no way for you to send the comment on a specific action, but what you can do, is add a comment statically on the receiving side when a certain action happens on the sending side. So for example, if side A gets assigned, you can add a comment on side B saying “Side A got assigned.” Here’s how you would accomplish that:
//Incoming Sync Side B:
if (!firstSync) {
if (replica.assignee != null && previous.assignee == null) {
issue.comments = commentHelper.addComment("Remote ticket assigned", false, issue.comments)
}
}
The “false” as a second parameter to the .addComment method means that you don’t want this comment to sync back to Side A in the subsequent synchronizations. I assume this is how you would like it to be, but if you do want this comment to sync back to Side A you can just set it to true.
Yes, the assignee needs to be sent from side A so that side B can apply that logic in the incoming, that doesn’t mean that the assignee will be set on side B, it just means you are sending that info from A so that side B can apply the correct logic when it realizes side A has set an assignee.
the line you need in your outgoing of side A is:
replica.assignee = issue.assignee
For your second question, if you wanted to add a static comment on B when side A is closed, you could apply a logic like this one:
//Incoming Sync Side B:
if (!firstSync) {
if (replica.status.name == "Closed" && previous.status.name != "Closed") {
issue.comments = commentHelper.addComment("Remote ticket was closed", false, issue.comments)
}
}
Do I need to be sending Assignee from Side A? We dont send the Assignee from A to B because that should never change for us on side B. it needs to stay the same.
I am using the code you sent me below:
//Incoming Sync Side B:
if (!firstSync) {
if (replica.assignee != null && previous.assignee == null) {
issue.comments = commentHelper.addComment("Remote ticket assigned", false, issue.comments)
}
}
I am doing this on Side B in the incoming rules but I am not seeing the comment being added. I think it may be because I am not sending the Assignee from A to B???