Get all sub task status before Parent Transition conditional execution

Nicolas Drabik June 1, 2017

Hi,

I'm trying to customize Parent Issue transition (JMWE plug-in) with conditional execution (groovy code)

I want for example to go back from In Progress to To Do if all SubTasks will be in To Do status

I have succed to check issue status and parent issue status with this code

if (issue.get("issuetype").name == "Sub-task")
   if (parentIssue.get("status").getName() == "In Progress")

Then I want to check status of all parent sub-task before return true

Pseudo-code:

for subTask in parentIssue {

   if(subTask.get("status").getName() != "To Do")

      if(subTask != issue)

         return false;

}

retrun true;

 

Does someone have an idea on how to implement this pseudo-code in real code in groovy conditionnal expression

Thanks in advance

0 answers

Suggest an answer

Log in or Sign up to answer