Transistion of parent issue depending on status of a sub-task with a specific name

Simon Kälberer January 9, 2019

Hello,

unfortunately I am not familiar with scripting. So I would hope that this matter can be solved otherwise. However we are using Jira Miscellaneous Workflow Extension and would like to do the following:

  1. Some parent issues have one sub-task with a specific name ("Review").
  2. If this specific sub-task ("Review") is not done an all other sub-tasks of the parent issue are done then the parent issue should transition in a certain status called "Waiting for Review".

How can this be done? I would be glad for any help or hints.

Cheers,

 

Simon

 

2 answers

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 10, 2019

Hi Simon,

unfortunately, you need a little scripting for that, as this too specific of a requirement to exist as a point-and-click solution.

You didn't specify whether you were on Jira Server or Cloud. I assumed the former.

You need to create a Transition Parent Issue post-function on the "Done" (or Close, or whatever) transition of the subtask workflow to trigger the "Waiting for Review" _transition_ (or whatever the name of the transition is that takes the parent issue to the "Waiting for Review" status). Then, on that post-function, you need to use a Conditional Execution script as follows:

(parentIssue.get("subtasks").any{it.get("summary") == "Review" && it.getAsString("status") != "Done"} //there is a subtask named "Review" and its status is not "Done"
&& !parentIssue.get("subtasks").any{it.get("summary") != "Review" && it.getAsString("status") != "Done"})

Note that you need to move the post-function to the bottom of the list. 

Simon Kälberer January 10, 2019

Hi David,

thank you very much for the prompt response. And of course for your solution.

The script works as intended and solved my issue.

Great work.

Cheers,

Simon

0 votes
Simon Kälberer January 10, 2019

I tried to solve this issue by using the following script as a condition

Collection subTasks = issue.getSubTaskObjects()
def transition = false;
def condition1 = false;
def condition2 = false;
subTasks.each{subtask ->
if(subtask.get("status") == "done" && subtask.get("summary")!="Review")
{ condition1 = true; };

if(subtask.get("status") != "done" && subtask.get("summary")=="Review")
{ condition2 = true; };

};
if (condition1 == true && condition2 == true)
{ transition = true; };
return transition

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events