Hi Dear community!
Trying to solve the issue: how to replace multiple symbols?
Using this smart value to replace a // with a . in the field summary.
{{summary.replaceAll("//", ".")}}
But how to replace multiple characters, for example // and \ and &?
Is it possible?
Thanks a lot!
Hi @Petr A
Reading the documentation, the automation team indicates their regular expression parsing is "based upon Java's Pattern class", but no where is it fully documented what automation does and does not support for regular expressions.
I recommend experimentation with a simple, manual or scheduled triggered rule to learn what is possible. For example, by testing I found character classes seem to work for replaceAll(), so you could try this:
{{issue.summary.replaceAll("[\&]", ".")}}
And then start chaining things which work to progressively remove things. I found doing too much at once with automation rule RegEx doesn't lead to predicable results.
{{issue.summary.replaceAll("[\&]", ".").replaceAll("//", ".")}}
Kind regards,
Bill
Hi @Bill Sheboy
As always, thank you very much)
Yes, with ReplaceAll + - understandable when you are dealing with one character. After several tests with errors, I already thought that multiple replacing does not work here.
But you gave me hope:D And after many errors this rule works for me and replaces &, /, \ symbols (for now anyway).
{{issue.summary.replaceAll("\\\\", ".").replaceAll("[\&]", ".").replaceAll("/", ".")}}
Have a good day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The question ❓ how explain itself to me based on the answers given herein. Thanks so much for your details explanation.
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.