Checking parent issue is in a specific status before sub task transitions from one status to another

Keylane ICT May 27, 2020

I've tried using the ScriptRunner plug in with a groovy script:

issue.parentObject.status.name == "REALISATION"

 

I used a conditional custom script to be placed at the transition between the statuses but it doesn't seem to work. I would like to use the scriptrunner plugin as we do not have the capacity for the jira workflow extension.

 

Thanks all.

1 answer

1 accepted

0 votes
Answer accepted
František Špaček _MoroSystems_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2020

Hello,

 

is really your status in capitals? Jira make them appear in capitals in UI, but you need to check proper status name in administration (Issues -> Statuses).

 

Also, better way to write the script like this:

issue.parentObject?.status?.name == "Realisation"

 Where ? makes it check if the object exists. In your solution if parentObject or status return null, script crashes. With ? it won't crash.

 

Have a nice day.

Keylane ICT May 27, 2020

Yes the status is really in capitals. Thank you for that insight, it did worked out in the end. :)

Margaret He
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 21, 2021

This script worked for me! Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.13.12
TAGS
AUG Leaders

Atlassian Community Events