Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,764
Community Members
 
Community Events
184
Community Groups

How to prevent from closing an Epic when it's stories/tasks are not closed

I would like to add a condition to a workflow in order to prevent closing an Epic when it's stories/tasks are not closed.

I understand that I need to use scriptrunner, but I don't know how and exactly do I need to write?

Can you please advise?

3 answers

2 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 04, 2021

Hi Orly,

I can confirm this requirement can be achieved using Workflow Conditions or Workflow Validators with ScriptRunner for Jira Cloud and I can confirm the question located here explains how to do this for your reference.

Regards,

Kristian

1 vote
Answer accepted

Hello @Orly Dahan

It is possible to do so with ScriptRunner for Jira Cloud. You can add a Scripted Condition in the closing Workflow Transition to run a script which ensures that all Stories in the Epic is completed. The script would look something as below:

// Validate that all issues below an Epic must be in the Done status before the Epic issue itself can be closed.
// The isEpic paramater returns true if the issue is an Epic and false if it is any other issue type
// The stories paramater returns all the issues below the Epic issue to allow there status to be checked. 
issue.isEpic && issue.stories.filter(story => story.status.name == 'Done').length == issue.stories.length //You may also want to set the Error message to have text similar to 'You must ensure all issues inside the Epic are in the Done status before the Epic issue can be closed'

Note: You might need to edit the script to suit your instance.

If you'd like to get more information, you can refer to the following links:

I hope this helps!

 

Kind regards,
Irfan

Hi Irfan,

Thanks!

I downloaded the JMWE which solves this in a very simple way.

Hi Orly, can you please help and explain what you did to stop it? :) 

Hi Amit,

We found a solution that does not involve ScriptRunner.

We downloaded JMWE app which adds options to configure the workflows.

It's very eazy to use

Orly

Hi, 

Thanks, do you have any documentation or links to share? :) 

David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 30, 2023

Actually, the right documentation is here: https://appfire.atlassian.net/l/cp/2b81MLj0

0 votes
David Fischer _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 21, 2020

I believe you could achieve this with ScriptRunner, but I'm not a ScriptRunner expert.

But you can also achieve this with a Linked Issues Status Validator from our JMWE app, which doesn't require any scripting for that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events