Script to tansition parent code status automatically based on child in JIRA Cloud using ScriptRunne

Yatam_ Annapurna September 12, 2019

My requirement is to update the parent issue status to "In Progress" automatically from "To DO" when th sub-task status changes to "In - Progress".


I have different workflows for both issue types and got some code in google search and tried to copy paste the same code in post functions at the "In Progress" transition on my sub-task. But unfortunately it is throwing an error saying "Unable to resolve the classes" that I had imported in the code. Later I found out that the code I am using is for server version of JIRA and as I am using cloud it is not accepting.

As I am a non-technical person, not able to understand how to approach with this.

 

Could someone please help me with code and the steps to implement this

 

1 answer

1 accepted

2 votes
Answer accepted
Michael Andolfatto
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.
September 12, 2019

Hi @Yatam_ Annapurna ,

You don't actually need to write any code if you're using Cloud. There is a pre-built ScriptRunner script called 'Transition parent issue' that is able to be selected when you add a ScriptRunner postfunction to your In Progress transition.

 

All you need to do is set the Transition ID to the ID of the transition that will take you to the In Progress status in your workflow, and set the Transition Name tied to that ID in the fields.

 

This should apply to all parent/child relationships, if you would like to restrict it to only sub-tasks you'll just need to add a simple scripted value.

Yatam_ Annapurna September 12, 2019

Yes, Thank you so much Mike. Even I just realized now while looking at the post functions in workflow.

Suggest an answer

Log in or Sign up to answer