Forums

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

Automation: Attempting to save smart value match() to variable but it returns empty

Kim Barry November 15, 2024

Attempting to find when a comment contains an email and save the email to a variable. I have an advanced compare to verify the comment has an email but it does not save to the variable, the second advance compare always comes back empty.

varEmail.png


2 answers

1 accepted

2 votes
Answer accepted
Salih Tuç
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.
November 15, 2024

Hi @Kim Barry , it is using Jira's Pattern class and look for matches. So, to mark a match, you need to use parentheses.

For example:

Instead of ".+@email.com", use "(.+@email.com)"

Of course, you need to modify the regex depend on your needs, it is just a dummy one :)

0 votes
Joseph Chung Yin
Community Champion
November 16, 2024

@Kim Barry -

Hi Kim:

Take a look of this Atlassian KB where it gives you some information on using Regex for automation -

https://confluence.atlassian.com/jirakb/extract-content-out-of-description-and-summary-with-regex-and-automation-1157495262.html

Hope this also helps.

Best, Joseph Chung Yin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events