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,455,650
Community Members
 
Community Events
175
Community Groups

Automation based on multiple key words in regex

Hi folks, having trouble with what I thought would be a simple automation.

I want to run the automation when a ticket is created, to check the summary for key words, for example (urgent OR important OR emergency) etc. and then set the priority of the ticket to Highest.

I would prefer to avoid a bunch of Ifs and Elses.

When I try to test this rule by sending in a ticket with the title "URGENT help" or similar, the rule does not fire, saying that the new issue did not match the conditions. Please help!

 

Andrey

 

automation regex question.JPG

2 answers

2 accepted

1 vote
Answer accepted

Hi @Andrey Alekseyev 

both comments above are great, and will fix your issue.

As an alternative - if you prefer to use JQL instead of regular expressions - you could use JQL condition instead of Advanced Compare.

Your JQL would probably look something like

summary ~ "urgent" OR summary ~ "emergency" ...

Hope that helps too.

Best regards,

Maksim 

Thank you @Maksim Marholin ! I should have been using the JQL condition all along, somehow didn't see it in the list.

1 vote
Answer accepted

Your regular expression is not correct, it should follow the Java regex. Also note that it is case sensitive, so in order to trigger on an issue that have URGENT or Urgent in it the regex should look something like this:

[uU][rR][gG][eE][nN][tT]

In your case if you want to use or and include multiple values in the compare the regex would look something like this:

([uU][rR][gG][eE][nN][tT]|[pP][aA][sS][tT]\s[dD][uU][eE])

Hi @Andrey Alekseyev 

Yes, and...to Mikael's answer...

Even after you get your regular expression figured out, the condition may still fail to match.  The reason is that the Issue Created trigger can fire very quickly, often faster than the data being available at the start of the rule.

If you encounter this symptom, the work-around is to add a Re-fetch action immediately after the trigger and before the condition.  This will slow down the rule and reload the data before proceeding with the next step.

Kind regards,
Bill

Like # people like this

Thank you @Mikael Sandberg and @Bill Sheboy - I completely misunderstood regex and should have been using the JQL condition in the first place. I did add the re-fetch action, and the rule works successfully now, thanks for the assistance.

Like # people like this

Suggest an answer

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

Atlassian Community Events