Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Transition Parent if subtask are closed

Hemanshu Sood
Contributor
September 12, 2018

Hi All,

 

I am looking for a scriplet to put in the workflow of a subtask :

If all subtasks of Type X are Closed then parent should be moved to next stage. I am putting this condition in the workflow of Subtask of Type X, using the below condition, but it is not working:

issue.parentObject.subTaskObjects.findAll{it.issueTypeObject.name ="XXX"}.each{it.resolutionObject.name == "Closed"} 

The parent transition occurs even if I close a single subtask of Type XXX, while I want this check to be performed for all subtasks of Type XXX.

 

Please assist

2 answers

1 vote
Tarun Sapra
Community Champion
September 12, 2018

Hello @Hemanshu Sood

This is a built-in script available in the post-function for the Script runner plugin, thus you can use it as it is i..e out of the box

https://scriptrunner.adaptavist.com/latest/jira/builtin-scripts.html#_transition_parent_when_all_subtasks_are_resolved

0 votes
Hemanshu Sood
Contributor
September 12, 2018

Hi @Tarun Sapra

this resolution is only valid when all subtasks( of all types) are resolved. My question is : what if we want to transition parent only when subtasks of a particular type are resolved only.

Tarun Sapra
Community Champion
September 12, 2018

For this you would need to write code but can you please explain why do you have sub-tasks of "different types" what's the use-case?

Hemanshu Sood
Contributor
September 12, 2018

Hi @Tarun Sapra

Use Case:

2 Kinds of subtasks X and Y are associated with a parent ticket.

There are 2 subtasks for type X and 2 for type Y. When I close only Y type of subtasks , parent should move a status further. I am using this condition to check ( fast track transition) , but it does not work:

 

issue.parentObject.subTaskObjects.findAll{it.issueTypeObject.name ="Y"}.each{it.resolutionObject.name == "Closed"} 

Suggest an answer

Log in or Sign up to answer