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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

708 views 6 13
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