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!
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
I had no clue there is problem with that, your solution worked like a charm. Thanks
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.