Forums

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

Issue description matches regex

Samuel Imrich March 19, 2025

Hello folks,

I want to achieve automatic clone of the issues (from some template project) based on the codes in the description. So, when new project is created, sample task is created automatically. User will then type in the codes of the services (like E002, A001 etc) into the description and move the task to DONE. This will trigger another automation that should:
1. read the codes one by one

2. lookup those codes in a different project (template project)

3. find matching issues with the code in its name

4. copy the issue into current project

This should work fine, it works with a specific code but it doesnt work when it should iterate. For some reason, when i try to use advanced branching, i cant get the regex work with this smart value 

{{issue.description.match("[A-Z]{1}[0-9]{3}")}}

giving me this error:

The provided smart value couldn't be resolved to an object

Also, I tried using custom fields instead of description (with multiselect), that works even better but the problem is that every time new project is created, those custom fields are not in the screen of newly created project so one has to add it there first. Also, those codes can be changing during the time so it must be easy for users to add/remove them, thats why i thought having a Template project with them will work the best (wonder if any tabular data used as a reference can be possible?)

Thanks!

Screenshot 2025-03-19 095715.jpg

2 answers

1 accepted

4 votes
Answer accepted
Bill Sheboy
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.
March 19, 2025

Hi @Samuel Imrich 

The match() function in rules has trouble with multiple values on a text line and newline characters.

To help the function, please try first replacing the newlines with spaces and then splitting the result on spaces into a list of items.  This will reduce the scope the match function needs to check:

{{issue.description.replace("\n", " ").split(" ").match("([A-Z]{1}[0-9]{3})")}}

 

Kind regards,
Bill

Samuel Imrich March 19, 2025

I had no clue there is problem with that, your solution worked like a charm. Thanks

Like Bill Sheboy likes this
1 vote
Tuncay Senturk _Snapbytes_
Community Champion
March 19, 2025

Hi @Samuel Imrich 

Would this work?

{{issue.description.match("[A-Z]{1}[0-9]{3}").split(",")}}

 

Samuel Imrich March 19, 2025

No, i am getting same error. Is this thing even supported? I dont think there is a problem with regex but more of a function itself.

Tuncay Senturk _Snapbytes_
Community Champion
March 19, 2025

You're absolutely right! I just wanted to check because I thought it (advanced branching) might expect a list of objects and using split might convert it to an iterable list.

So, I'd suggest:

- create a variable first (let's say name: codes and the value is as the below)

{{#issue.description.match("[A-Z]{1}[0-9]{3}")}}{{.}},{{/}}

- then perform advanced branching

smart value: {{codes.split(",")}}

variable name: matchedValue

logging in between might also be beneficial.

Apologies if I was causing confusion.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events