Jira Automation: How to start and close Epic automatically depending on contained issue transitions?

Ingo Mohr November 5, 2021

Hi all,

I would like to start and close my Epics automatically by working on the epics's issues alone.

i.e.

* when I start the first of its issues, the Epic should be transitioned to a certain status in its workflow

* when I close the last of its issues, the Epic should be closed, too.

 

How can I do this w/ Jira automation?

 

3 answers

2 votes
Bill Sheboy
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.
November 5, 2021

Hi @Ingo Mohr 

Yes, you could do this for specific status values or generically (with statusCategory). I encourage you to experiment and try both ways to learn about automation rules.

For example as generically, ignoring issue status:

  • trigger: issue transitioned (status values do not matter)
  • condition: issue type is Story, Task, or Bug
  • related issues condition: epic exists
  • if/else...
    • advanced compare condition: statusCategory is "in progress"
    • branch: on epic parent
      • condition: epic is not in progress
      • action: transition it to your in progress status
  • else
    • advanced compare condition: statusCategory is "done"
    • action: lookup issues with JQL with the same parent that are not done
    • advanced compare condition: {{lookupIssues.size|0}} equals 0  (so, everything is done)
    • branch: on epic parent
      • condition: epic is not already done
      • action: transition it to your done status

 

Kind regards,
Bill

Ingo Mohr November 13, 2021

Thanks @Bill Sheboy

I had to fiddle around a little bit - but I could get the rule up and running. :)

Bill Sheboy
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.
March 30, 2023

Hi @Adam Ziecik 

I do not believe so, as this approach uses the Lookup Issues action, which is not supported by the Server/Data Center version you are using.

Please see the other thread for my additional suggestion.

Kind regards,
Bill

1 vote
Daniel Turczanski - __JQL Search Extensions
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 10, 2021

Hi @Ingo Mohr ,

If you have our JQL Search Extensions, you can create a scheduled daily or hourly rule to find the epics that need to be transitioned:

type=Epic AND statusCategory="To Do" AND (issuesInEpicToDoCount>0 OR issuesInEpicInProgressCount>0) 

You can find more examples in the documentation.

Thanks!

Ingo Mohr November 13, 2021

Thank you @Daniel Turczanski for suggesting your plug-in. It's not my Jira instance, however. But still: good to know :)

1 vote
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2021

Your automation should look something like this:

Screen Shot 2021-11-05 at 4.01.16 PM.png

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 5, 2021

And if you look in the library you will find an automation that will close the epic once all stories are done.

Ingo Mohr November 13, 2021

Thanks @Mikael Sandberg !

This worked - and I think this helps me get going too for other rules.

 

### Suggestion

However, while I was editing the rule, I asked myself why there isn't a feature to specify rules as a script - maybe directly with a Bitbucket Repo link - so that I can maintain rules in Bitbucket (with tags) and then refer to the tag of a rule script in Bitbucket...

Is this something you can take back to the team - as a community leader?

 

Thanks

Ingo

Suggest an answer

Log in or Sign up to answer