Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Transition Parent if subtask are closed

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 Leader Sep 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

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 Leader Sep 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?

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
TAGS
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

3,986 views 11 5
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you