Using JMWE can I automatically transition an epic when all its related stories are resolved?

I'm on JIRA Cloud and I'm looking to transition an epic when all of the linked tasks or stories are complete. 

I found something on line but it's not working for me. I'm not sure what I'm doing wrong. 

Automatically transition the Epic when all Stories are resolved.

 Steps

  • Add the Transition current issue post-function to the Resolve transition of the Story workflow.
  • Input the transition name or ID of the Resolve 
  • Select the check box Run this post-function only if a condition is verified.
  • Write the following content in the Conditionsection.

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

{% set trigger = true %}

{% for story in stories %}

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

        {% set trigger = false %}

    {% endif %}

{% endfor %}

{{ trigger }}

  • Place this post-function at the end in the list of post-functions.

Any help with this would be great!

Thanks,

Dale

3 answers

1 accepted

1 vote
Answer accepted

Hi Dale,

you want to use the "Transition Linked Issues" post-function instead, to transition the parent Epic, not the current issue (Story). The rest seems correct.

David

Thanks Dave. It looks like I've finally got that working. 

One more questions, can I do the same thing but from the Epic? Can I add the post function there, on the epic, to resolve the epic when all of it's stories are resolved? My problem is there may be stories under the epic that belong to different projects (hence different workflows). 

Thanks Dave. It looks like I've finally got that working. 

One more questions, can I do the same thing but from the Epic? Can I add the post function there, on the epic, to resolve the epic when all of it's stories are resolved? My problem is there may be stories under the epic that belong to different projects (hence different workflows). 

No, for the simple reason that the Epic is not aware of its Stories being transitioned - hence the Transition linked issues post-function on the Story transition. 

Makes sense. Thanks so much for your help!

This comment was based on a since-resolved misunderstanding and was not helpful so I have removed it. Tried to delete it but can't!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Jira

Updates to jira.atlassian.com give you visibility into what's coming in Jira Server and Data Center

Hello, Community! My name is Gosia and I'm a Product Manager on Jira Server and Data Center here at Atlassian. Since 2002 when we launched our public issue tracker, jira.atlass...

447 views 1 14
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you