How to trigger a parent transition from specific subtasks status

Kelsey Berry April 8, 2024

I'm trying to trigger a transition of a parent task when all specific subtasks are in a certain status but I'm not familiar with scripting. I've done something similar with the JMWE Transition Issue(s) Post Function when there's one subtask type and separate workflows between the Parent and the subtask. The issue I'm facing is that they share the same workflow and there may be different subtasks types on the parent. This is the specific scenario:

Transition the Parent ticket to the "Feature Review" status via the "Feature Review-auto" transition when all "Dev Task" subtasks are in the "Feature Review" status. 

Can anyone assist with the right script for this? Thanks!

1 answer

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.
April 9, 2024

Hi @Kelsey Berry 

you can use the same Transition Issue(s) Post Function on the transition to the "Feature Review" status to trigger the Feature Review-auto transition on the Parent issue, but you need to add a Conditional Execution script as follows:

issue.get("issuetype").name == "Dev Task" && issue.parentObject.subTaskObjects.every {
it == issue || it.get("issuetype").name != "Dev Task" || it.get("status").name == "Feature Review"
}

 

Kelsey Berry April 9, 2024

Thanks for the response! Unfortunately it didn't work for me. This is how I have it configured if I messed something up. 

To test the scenario, I moved the only two "Dev Task" subtasks to the "Feature Review" status but the parent didn't also update to the "Feature Review" status at that point. 

featurereview_postfunction.PNG

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.
April 9, 2024

Hi @Kelsey Berry 

sorry it didn't work. 

First of all, try selecting the "Parent Issue " of the "Issue/subtasks" relationship, not the Portfolio hierarchy. Also, try testing without the conditional execution script to make sure the parent issue is then always transitioned to the Feature Review status.

Let me know how that goes

Kelsey Berry April 9, 2024

Ah, there was the problem. All good now. Appreciate the help!!

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.
April 9, 2024

I'm glad it worked.

Can you please "accept" the answer so others can find it more easily?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events