You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.