Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with an automation rule to send an email on any comments from customers with escalation verbiag

Sara Nicholson
Contributor
October 8, 2025

I have an automation rule in our JSM project to send an email when the field "Initial customer comment" has any escalation verbiage (i.e., escalate, urgent, critical, etc.). The rule is sending the email, but it is sending it for ALL initial customer comments, not the ones that have the specific words. Can someone tell me how I would do this? I have tried many different ways. Here are a couple of examples of what I've tried:

2025-10-07_11h58_19.png2025-10-08_14h34_53.png

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.
October 8, 2025

Hi @Sara Nicholson 

Short answer: please try the match() function with your regex and experiment to perform that test rather than using the contains condition.

 

There is nothing in the automation documentation about what is (or is not) actually supported for regular expressions.  Instead, it states this, with emphasis added by me: 

match()

Performs a regular expression search and returns the first (and only one) matching regular expression group.
 
The underlying implementation is based on Java's Pattern class and...

Community questions have several examples that do not match the linked Java spec.

And...there is no documentation on what else the rule engine adds to the regular expression in the Smart Values Condition when the contains option is used.

 

I recommend trying your regular expression with the match function directly and then testing for non-empty results.  You may also try:

  • Before anything else, confirm you have the correct smart value for your field using this how-to article.  Smart values are name, spacing, and case-insensitive, and do not always match the field names shown in the views.  You may also use the custom field ID to reduce uncertainty.
  • Rather than using case-insensitive matching, add the toLowerCase() function before the match() and remove (?i) from the regex
  • The match() function has trouble with newlines, so I recommend replacing first with replace("\n", " ")
  • To reduce the scope the match needs to check, add a split(" ") before the match(), and at the end, test if the resulting list size is greater than zero for any matches

 

Kind regards,
Bill

0 votes
Deivid Araujo
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.
October 8, 2025

Hi Sara!

 

Regex is always tricky and something that you'll have to do a lot of testing (at least for me). For your case, since the regex condition may be case sensitive, It's always good to "normalize" the text, using the .toLowerCase() function.

 

Also, try this regex instead:

.*\b(escalate|urgent|critical|priority|important)\b.*

 

Hope it helps

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events