Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to replace symbols?

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!

1 answer

1 accepted

1 vote
Answer accepted

Hi @Petr 

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!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

614 views 21 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you