Automation based on multiple key words in regex

Andrey December 12, 2022

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
Maksim Marholin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2022

Hi @Andrey 

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 

Andrey December 13, 2022

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
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.
December 12, 2022

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])

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.
December 12, 2022

Hi @Andrey 

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
Andrey December 13, 2022

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
AUG Leaders

Atlassian Community Events