Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
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 to check if issue not yet exist in automation

I know there is JQL like this to find if it is exist:
Summary ~ "keyword"

How about to check if it is not exists?

I am trying to write sth like:
if(issue not exist){ create issue }

However I can now only write sth like this (I have to add rubbish action otherwise it gots error):
if(issue exist){ rubbish action } else {create issue}

1 answer

1 accepted

1 vote
Answer accepted
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 10, 2023

You can check the Summary for the absence of text. For example...

summary !~ "hello"

The above would return all issues that do not have the word hello in the summary field. Note, checking for the absence of text can be a bit fragile.

Following the JQL statement you can check for the number of items returned and if zero, you can proceed with your action.

I have tried sth like this:
(summary ~ "hello") = 0

However JIRA won't let me pass, is there anything I've missed?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 10, 2023

no, that will not work. you need to create an automation rule. I mistakenly assumed that was the environment you were working in.

So that I might be able to further assist let's step back a bit. Could you explain your exact use case? What is it that you are trying to accomplish and why? It seems that you wish to create an issue of a certain summary if an issue with that summary does not exist. However I may be off a bit here and I think a better understanding of the exact requirements would help.

> It seems that you wish to create an issue of a certain summary if an issue with that summary does not exist.

Yes, exactly, you already got it.

I am working on creating an automation rule, and writing an JQL query in the if-block, writing sth like (summary ~ "hello") = 0 and hoping it would work but getting a red error unfortunately.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Oct 11, 2023

Hi @Devon Chan ,

I've taken the time to create an automation for you which is illustrated below. To be honest I'm a bit perplexed by your use case and how you plan to run this query. I can't imagine that you're checking for the same text repeatedly. Maybe you're wanting some dynamic automation where it would prompt you for the text to search for and then if nothing found create a new issue? 2023-10-11_12-50-20.jpg

Like Devon Chan likes this

Thank you Jack!!

My instinct feel that there should be sth like "insert into if not exists" as in SQL, however JQL do not have a simple way to do that, which makes me feel weird.

Anyway, I can tell you my use case. I have to manage more than 60 products at the same time therefore I have to make this efficient enough to make product cards with tags, every month. That's why I need the automation to do that for me instead of manually making every card by hand.

Wish you a nice day :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events