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

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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,264 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot