Don't sync comments on specific condition

Originally asked by Kushal Gupte on 19 May 2021 (original question)


I have 2 projects A and B created in JIRA. I have established the connection between then using exalate. The ticket in project A re-opens when customer comments on a resolved ticket. It changes the status from Resolved to In progress. This latest comment gets synced into project B and the ticket in projecy B also reopens. But the ticket in project B should not re-open.


Answer by Francis Martens (Exalate) on 22 May 2021

You will have to construct the necessary logic in how status is being mapped.
This can be done with a script rule where you don’t apply the change if the issue is closed.


Comments:

Kushal Gupte commented on 23 May 2021

Hey Francis,
Can you give any documentation link or the sample script?

Francis Martens (Exalate) commented on 23 May 2021

Euh - something like - pretty straightforward.

Jira B - untested

def targetStatus = ...
if (issue.status.name != "Closed") {
   // only apply a status change if the issue is not closed
   issue.setStatus(targetStatus)
}

You will have to take into account that if the status from B is synced back to A, you will have to avoid to close the issue A because the issue B is still closed.