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

This widget could not be displayed.

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). 

This widget could not be displayed.

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 widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

169 views 2 0
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