How to escape regex in smart values

Raul Nemes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2024

Hi, I'm trying to replace 3 characters in a string as part of an automation condition.  What I want to do is find each { } ~ and replace any of them with a space. My comment.body string will have multiple occurrences of those characters throughout.

effectively I'm trying: {{comment.body.replaceAll(REGEXGOESHERE, " ")}}

I want to use ({|}|~) in place of REGEXGOESHERE

When I try this it fails to get the comment body.

Any thoughts?

 

 

2 answers

1 accepted

1 vote
Answer accepted
Raul Nemes
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2024

was able to get the Regex to work with [{}~] instead. 

0 votes
Divyanshu Gupta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 26, 2024

[\{\}\~]

Suggest an answer

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

Atlassian Community Events