Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I am trying to parse the description field of a ticket raised by a separate integration.
The description field contains:
*Organization:* ABCTECH
*Owner:* John Smith
And I am trying to set another field's value using:
{{issue.description.match("(?<=Organization:\* ).*")}}
Testing the regex separately returns the match, the automation runs, but the field is never populated.
Hi @Neil B -- Welcome the Atlassian Community!
Have you tried a simpler match expression to return the value, perhaps to the audit log before trying the field edit?
In my experience thus far, the regular expression handling for automation rules does not consistently implement the references in the documentation. And, even within a rule some different rule components may lead to different behaviors...particularly when leading/trailing smart value expressions collapse to null.
Kind regards,
Bill
Hi Bill - thanks. This could be my misunderstanding of how match works.
In my regex test with {{issue.description.match("(?<=Organization:\* ).*")}} against
*Organization:* ABCTECH
*Owner:* John Smith
I get no results. With a simpler {{issue.description.match(".*(Org).*")}} it does match and returns 'Org'.
When I test the regex elsewhere I get for "(?<=Organization:\* ).*"
And then for ".*(Org).*"
So it looks like match is returning group index 1?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup...Maybe divide and conquer this one by splitting to lines to isolate the searching. This worked for me when I tried your example description:
{{issue.description.split("\n").match(".*Organization:\*(.*)")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've been struggling with a similar case and i found that enabling dotall mode fixes it.
In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.
You can enable this by adding the embedded flag expression (?s) in front of your expression.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neil - Welcome to the Atlassian Community!
Can you share the rule that you have (screenshot)? And the Audit log for when you run it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for sharing. And what does the value for the Summary field look like after the update?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad Bill got you all fixed up.
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.