Hi all,
I am sure this is quite simple but not knowledge enough in smart rules to get this working.
I am needed to remove numbers from a text string in which Jira Automation takes the custom field from a linked issue and inputs into the target issue.
However I need to remove numeric values example
Linked issue value:-Daniel11223344
|Copied to Target issue value :- Daniel
I have almost got it working with the following:-
{{issue.Unit/Site Name.remove("0")}}
This does remove the string "0" however cant figure out how to remove all other numbers i.e [0-9]
How do you include multiple values in .remove?
I have tried teh below with no luck
{{issue.Unit/Site Name.remove("[0-9]")}}
{{issue.Unit/Site Name.remove("0","1")}}
The function remove() gets rid of one character. Maybe try replaceAll() instead using a regular expression:
{{issue.Unit/Site Name.replaceAll("([0-9])","")}}
Please look here for more information about that function, and the reference to regular expression syntax:
https://support.atlassian.com/jira-software-cloud/docs/smart-values-text-fields/
Best regards,
Bill
Thanks Bill,
That did the trick.
You could also use the remove function by doing the below but not very elegant
{{issue.Unit/Site Name.remove("0").remove("1").remove("2"}} etc etc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am glad that helped. And...I would expect that chained removal to be a bit slower, and "maintenance unfriendly". ;^)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah its takes a second longer that way ...but every second counts right :-)
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.