Is it possible to trigger a script listener only when a transition is made and status is changed using 'Issue Updated' event?
We tried the below line of code. Did not work:
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find
{it.field == "status"}
if (change) {
log.error "Value changed from ${change.oldstring} to ${change.newstring}"
// your actions if the field has changed }
We have also tried getting issue current status using issue?.status.name and previous status using originalIssue.status.name on the issue update event. But these also didn't work as the issue?.status.name is giving the previous status and not the current one.
Kindly let us know if we are doing something wrong here.