Synchronize status only if certain changes were made

Originally asked by Johannes on 22 June 2023 (original question)


Hello,

currently my Exalate connection synchronizes the status for every change made to a ticket.

Now I would like to change it in such a way that the synchronization happens only if the last change/update to the issue was an update to a specific status.

So the pseudo code would be:

if(status changed in last update to “In Progress”){

update status

}

How can I achieve this (on Jira Server)?

Thank you

Johannes


Answer by Syed Majid Hassan on 23 June 2023

The replica represents the payload arriving from the remote end.

Similarly, previous represents the last copy of the replica,

and you should be able to use these to achieve what you are looking for.

For instance, if you want to change status only if the status on the remote end changed to X, you would:

if (replica.status.name == "X" && previous.status.name != "X")

        update status

Some more reading on the subject is here.

If this resolves the issue, please mark the answer as accepted.

Happy Exalating!

Majid


Comments:

Johannes commented on 23 June 2023

Thank you, that is exactly what I was looking for!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.