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:
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:
Kind regards,
Bill
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.