change WF state after all subtask are closed

hi there

i am creating subtask automatically in transition (transition "Error occured" creates subtask) ....

i would like to automatically change state from "Error" to "in progress" after all subtask are closed ... now i have a transition "bugs resolved" with subtask blocking permission ... is it possible to make it automatically?

thank you

3 answers

1 accepted

0 votes
Answer accepted

i have solved this problem with

Script Runner (

this plugins has build in example:

  • Auto-transition parent when all sub-tasks are resolved

I add this post script function to "Close" transition on subtask (in IE i cannot add this function, try it in Firefox ;) ) and it works nice :) (subtsask must have resolution!)


Its definitely possible, but its a little tricky: your best bet is to write a EventListener that listens for a particular event type that you throw during the transition of the subtask (for instance, the Close Issue event). Basically, when the subtask is marked as Closed, the Close Issue event is fired, the EventListener picks it up and can do some basic checking, such as:

* is the issue that fired the event the issue type I care about

* does the issue that fired the event have a valid parent issue to auto-transition

* are all the other subtasks on that parent closed

=> then, transition the parent issue.

The biggest problem here is that the listener will pick up _all_ Close Issue events, so you'd want to short circuit that down as fast as possible, as above, or depending on your expected volume, potentially even write your own Event type.

Hope that helps.


thank you for advice.

but please, can you be more specific? some code examples with places to save the code? :)

Listener can be added in System - Advanced - Listeners. but i would need template codes ... thx

Hi Peter,

as far as I know automating transitions is not possible with any plugin available or even out of the (JIRA) box. You can however use one of the scripting plugins to and write a custom script which would do the job for you.

Anyway be advised that by doing so, this may easily can result in inconsitent dtat in your database as you have to allways keep the status and the according workflow step in sync. Also automating your workflow as described is possible you may wish to question the backgroud/use case of this sollution. Apart form inconsistent data there is always a chance of misconfiguration which may block your workflow on some point.

Regards, David

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in United States

Confluence Security Advisory

Good morning Members, Not sure if you are aware. Please read the following: More details: https://co...

57 views 1 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you