You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I am attempting to extract a 6 digit number from the summary when certain text are present, my rule is successful but the regex is not entering into the field.
edit issue expression:
COMPANY SO # 123456
I am expecting "123456" to populate my custom field however it remains empty. on regedex101 the statement works correctly.
What am I missing?
Hi @Jason Barber -- Welcome to the Atlassian Community!
Two things to consider when using the match() function in automation rules...
First, the documentation describes the "underlying implementation is based on Java's Pattern class and uses Matcher.find() to find matches". However it does not indicate what actually is (or is not) supported for regular expressions. I recommend using the simplest expression that can possibly work, and always test to confirm the results. Especially for any edge-cases.
Next, the match() function for rules returns only one match, and appears to treat line breaks as points to stop searching. (Please see my above paragraph...)
The work-around is to always split on newlines first before attempting matches. This will potentially result in a list of responses, and so ensure you handle that. For your expression, try adding .split("\n") before the match() call.
Just following up to check if this answered your question. If so, please consider marking this one as "answered". That will help others with a similar need find solutions faster. If not, please let the community know what help you need with the rule changes.