Stop Epic from closing if unresolved stories/tasks

Murugan Mittapalli May 30, 2018

I would like to Stop Epic from closing if unresolved stories/tasks, These are not like Sub task blocking condition.

2 answers

4 votes
Luca Calderone May 19, 2022

Hi @Murugan Mittapalli and team, 

Please find below a solution applicable to Cloud Jira (Premium or Enterprise, as long as you got access to Automations) which doesn't rely on third party add-ons (e.g. JSU, JMWE or Scriptrunner).

1. Create a custom number field (e.g. EpicClosure or FeatureClosure)

2. Add a "Value Field" Condition to the Done/Cancelled Epic Workflow transition to allow closing only if the EpicClosure is 1).

3. Create an automation rule to set EpicClosure to 1 when all the Stories which link up to the Epic are Done/Cancelled.

(When: Issue Transitioned - For Epic (parent) - if: Stories match Status in (Done, Cancelled) - then: Edit issue fields EpicClosure to 1).

4: Create a second automation rule to set EpicClosure to 0 when Stories aren't all in Done or Cancelled.

(When: Issue Transitioned - For Epic (parent) - if: Stories match Status not in (Done, Cancelled) - then: Edit issue fields EpicClosure to 0).

Hope this helps and have a good one.

Luca Calderone 

Jira Admin

Lucian Marginean July 12, 2022

Neat idea.

I believe it needs a 3rd automation rule for new Stories created

(When: Issue Created - For Epic (parent) - if: Stories match Status not in (Done, Cancelled) - then: Edit issue fields EpicClosure to 0).

Like # people like this
Luca Calderone July 12, 2022

Hi @Lucian Marginean ,

Thanks for pointing this out, you're completely right!

Like Eli Albert likes this
Eli Albert May 9, 2023

@Luca Calderone  @Lucian Marginean 

This is a really great idea!  but what about the following scenario:

some epics don't have any child issues, so in this case the field" EpicClosure" will always be empty and the transition will be blocked...

Do you have any solution for this?

and indeed, for epics that have child issue this is an excellent solution.

Thanks!

Like # people like this
4 votes
ASweeten
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 6, 2018

Hello Murugan,

Thanks for reaching out to us with this inquiry.  It is possible to achieve the required functionality by utilizing a Condition provided by the Jira Misc Workflow Extensions plugin.  Once you install this plugin, you can follow the below steps to force the Epic to remain open until all child Stories are close:

  1. Edit the workflow
  2. Modify the transition that leads to your Epic's closed status (e.g., Done, Resolved, Closed)
  3. Click on the Conditions tab -> Add condition link
  4. Select 'Linked Issues Status Condition (JMWE add-on)' -> Add button
  5. Choose 'is Epic of (from Epic to Stories)' -> check the relevant closed statuses
  6. Click Add button
  7. Publish your workflow

Cheers
~Andrew Sweeten
Atlassian Support

Murugan Mittapalli June 6, 2018

Thank you for your reply Andrew, Can we use Script runner to resolve this.

Esther Strom December 13, 2018

@ASweeten - I found this via a google search. We have JMWE installed on our cloud instance, but I don't see any conditions added by JMWE. I do see (and have used) JMWE-specific post-functions. We used the add-on in our on-prem install, and conditions are available.

I just checked the knowledgebase for the add-on, and it indicates that due to the Connect framework for Cloud, conditions and validators are no longer available via the add-on, but have been integrated natively into Jira Cloud.

So where can I find the Linked Issue condition you mentioned in your answer? I'm not seeing it...

conditions.png

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.
December 13, 2018

Unfortunately, only the Conditions and Validators that were available in JMWE for Jira Server mid-2016 were integrated natively into Jira Cloud, and the Linked Issues Status Condition isn't one of them.

Unfortunately, until Atlassian makes configurable Conditions and Validators available to apps, you won't find any solution to your problem on Jira Cloud.

Esther Strom December 13, 2018

Thanks for the response, @David Fischer. Not the answer I was hoping for, but I can't say I'm surprised.

Suggest an answer

Log in or Sign up to answer