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

How do I use JIRA automation to check if there exists an issue with a specific summary text in an Ep

Peter Ruan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Oct 28, 2023

How do I use JIRA automation to check if there exists an issue with a specific summary text in an Epic? And if it does not exist, then create it.

I don't know if that's possible, that's why I'm asking. I've tried using For Stories branch but if the Epic doesn't have any sub issues, then the For Stories loop won't even get triggered.

2 answers

0 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.
Oct 29, 2023

Hi @Peter Ruan -- Welcome to the Atlassian Community!

One way to do that in an automation rule is:

  • write a JQL statement to find the issue (e.g., where the parent equals the epic's key and the summary contains what you want to check)
  • use that JQL with a lookup issues action
  • check if the result count is 0 (i.e., {{lookupIssues.size|0}} equals 0, using and advanced compare condition)
  • and if the count was 0, create the issue

Kind regards,
Bill

Peter Ruan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Nov 02, 2023

Hi @Bill Sheboy thanks for the tips.  Can you please elaborate a bit more? 

I've the following use case:

  1. a JQL finds all affected issues
  2. loop through all the results from step#1, which are all Epics, to check if there are issues that have:
    • 0 matching issues within the Epic to the 3 pre-defined issue summaries (A, B, and C ) and creating them.
    • if there are matching User Stories in the issue, figure out which of the 3 are missing and create them accordingly.

I am able to do #1, but am stuck on #2.  TIA!

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.
Nov 02, 2023

That seems a variation on your question, as you now want to check for multiple, pre-defined summaries. 

For that case, I recommend doing these one by one to confirm presence of each issue before proceeding.  Trying to do this in a loop may be possible, but seems like the behavior will be less predictable.

Perhaps like this, using if/else conditions...

  • use Lookup Issues with JQL to detect your case A
  • with an if/else condition
    • check if the count is 0 for the lookup
    • create the issue(s) needed
  • use Lookup Issues with JQL to detect your case B
  • with an if/else condition
    • check if the count is 0 for the lookup
    • create the issue(s) needed
  • use Lookup Issues with JQL to detect your case C
  • with an if/else condition
    • check if the count is 0 for the lookup
    • create the issue(s) needed
  • ...

I had the same problem a while ago, and chose to solve it through the workflow. As I can not run an automation on an Issue that does not exist, I did the check on Create and then - if the summary already exists - moved it to a „Duplicate exists“ status. There the assignee was able to resolve the problem.

Not really what you want, but afaik checking values before the issue is created can not be done with automations (yet)

Suggest an answer

Log in or Sign up to answer