[JIRA] Autotransition Subtasks on Parent Transition?

I'm trying to create a (k) SIL Post-function using JJupin to allow me to autotransition all subtasks in a status called "On Hold" when it's parent issue goes to a status of the workflow called "On Hold" through a transition called "Set On Hold".

The problem is that the Parent issue has a workflow which differs from those the subtasks have.


Parent Issue -> Workflow 1

Subtask type 1 - > Workflow 2

Subtask type 2 -> Workflow 2 (the same as type 1)

Subtask type 3 -> Workflow 3

Parent status = "On Hold", ID: 9

Parent transition = "Set On Hold", ID: 241

Subtask type 1 status = "On Hold", ID: 17

Subtask type 1 transition = "Set On Hold", ID: 511

Subtask type 2 status = "On Hold", ID: 17

Subtask type 2 transition = "Set On Hold", ID: 511

Subtask type 3 status = "On Hold", ID: 18

Subtask type 3 transition = "Set On Hold", ID: 561

I'm using this code but it does nothing:

//autotransitioning subtasks in `On Hold`
//when parent task is trasitioned in `On Hold`

string sub;

for (sub in subtasks(key)) {

//if found subtask that has not been transfered to `On Hold`
if (%sub%.status!="On Hold") {
//then execute the transition to `In Progress` state
autotransition("Set On Hold", sub);

Could someone please help me with the code?

3 answers

1 accepted

0 votes
Accepted answer

Routine autotransition cant execute like this

autotransition(transitionid, issueKey)

In this case, it's like this

Subtask type 1
autotransition(511, sub)

Subtask type
autotransition(511, sub)

Subtask type 1
autotransition(561, sub)

works! but no validators or conditions should be on the transition of the subtasks (511, 561)

It should work both ways. Are there any exceptions in the logs?

Try using autotransition("Set On Hold", sub, true);

By the way - I would recommend using the name of the transition as opposed to the ID. For example.. we work in an environment where we have a dev Jira server and a production Jira server. The transitions are named the same on both boxes, but they aren't necessarily numbered the same. This allows portability.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

460 views 8 27
Read article

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