How to transition an Epic on when a child issue transitions?

Matt Mace January 4, 2019

I want to be able to transition an Epic when one of it's child issues transitions to the next state in a workflow.  For example Epic and children are in ToDo state and one of the child issues is moved to In Progress. This would trigger the Epic to move to In Progress also regardless of the state of the other children. However, when a child moves to Done the Epic will not transition until all of the child issues have transitioned to Done first. (I think I can just reuse this piece for the Done transition:

{% set stories = issue | epic | stories %}

{% set trigger = true %}

{% for story in stories %}

    {% if story.fields.status.name != "Done" %}

        {% set trigger = false %}

    {% endif %}

{% endfor %}

{{ trigger }}

(Please tell me if I'm wrong in that assumption...)

I'm not a programmer so if someone could just provide a Nunjuck code snipet I could paste into the post-function it would be greatly appreciated.

1 answer

0 votes
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 5, 2019

I believe that's exactly the conditional execution code you need for the transition linked issues post-function. Just make sure you also add a delay (~2 seconds) to the configuration so that the current story's status is up to date. 

Matt Mace January 8, 2019

The script I included handles the Epic transition if ALL child issues have moved to "Done". But what about the first part of my question which is to transition the parent Epic when the first child issues transitions to "In Progress"

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 8, 2019

For that, you also use a Transition Linked Issues post-function, without any conditional execution. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events