I built an Automation rule a while back that allows certain people to manually trigger a request to transition an issue to a hidden status if it's already linked to another issue.
The basic setup is as follows:
[A-Z]+-\d+
This worked for some time, but wasn't used often. It looks like it was last successfully executed on 2025-08-14. At some point between then and today, it stopped working.
Doing some testing, I learned that any use of .upperCase now returns a blank value and similarly .match() also returns a blank value. Thankfully, I was able to find .toUpperCase() as an alternative that works, but there is no alternative to .match().
I tried passing the raw input to my If/Else block and can confirm that the regex is correct. However, I need a method of stripping the extraneous parts of the string so that I can pass the key into a Lookup.
Hi @Brock Jolet
Without seeing your entire rule and audit log details...
I hypothesize the problem is any extra characters you do not want to match upon are not handled with the regular expression passed to the match() function. Perhaps try adding some tokens outside of the selection, writing the results to the audit log for testing, such as:
{{userInputs.ticketNum.trim().toUpperCase().match("^.*([A-Z]+-\d+).*")}}
And as a reminder, there is no automation documentation for what actually is (or is not) supported for regular expressions in automation rules, and so experimentation is required. What the docs say, with emphasis added by me, is:
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 uses Matcher.find() to find matches. If multiple matches are found, they return as a collection that can be iterated...
Kind regards,
Bill
Thanks for this suggestion, @Bill Sheboy . Using your smart value, I didn't get the full issue key, but I did get part of it, which is better than a blank result. So, this implies a problem with the regex after all as opposed to a blanket issue with .match()
I'm going to try more digging to see how far I can get.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think I've got it working with this smart value.
{{userInputs.ticketNum.trim().toUpperCase().match(".*?([A-Z]{2,}-\\d+).*")}}
I must have been compounding issues somehow when testing .match() previously.
Thanks for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well done!
Every time I see a question like this, I plan to create a test rule to exercise regex expressions in different contexts, and leave it running on a schedule as a "canary" to detect any changes. Then I forget about it...and it goes to the bottom of the experiment priorities :^) I'll make an index card for it this time to remember.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Brock,
I suggest you go ahead and open a support ticket with Atlassian while you are waiting on other responses. It won't hurt and might get your answer quicker in the long run, especially if there is some type of bug that has been introduced.
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.