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

Dale Bosserman January 17, 2018

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

4 answers

1 accepted

1 vote
Answer accepted
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 17, 2018

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

Dale Bosserman January 17, 2018

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

0 votes
Самрук Алена May 29, 2020

Hi, can you help how to write this condition for JIRA server not for Cloud? 

Radhika Vijji _Innovalog_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2020

Hi, 

Here it is: 

if(!issue.epic)
return false
linkedIssue.stories.every{it.status.name == "Resolved"}

Regards,

Radhika

Самрук Алена May 29, 2020

It works! Thank you, so much Radhika! 

0 votes
Christian Rodriguez February 13, 2018

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!

0 votes
Dale Bosserman January 17, 2018

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

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 17, 2018

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. 

Dale Bosserman January 17, 2018

Makes sense. Thanks so much for your help!

Suggest an answer

Log in or Sign up to answer