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.
So:
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?
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)
Check the notes here: http://confluence.kepler-rominfo.com/display/SIL/autotransition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
works! but no validators or conditions should be on the transition of the subtasks (511, 561)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It should work both ways. Are there any exceptions in the logs?
Try using autotransition("Set On Hold", sub, true);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.