Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Use smart values to cut '{' from text

Clemens Rätze February 1, 2024

I would like to use smart values to cut text between '{' and '}' from a description.

To start simple I tried this:

{{issue.description.replaceAll("{","")}}

But it is not working. It works with other text than {. Is there a notation to use { in smart values?

 

2 answers

1 accepted

2 votes
Answer accepted
Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2024

Hi @Clemens Rätze ,

I did not try it myself, but I think you need to escape the {, by using \{.

{{issue.description.replaceAll("\{","")}}

 

 

Clemens Rätze February 1, 2024

That's it, thanks.

In case anyone is wondering, that's my final value:

{{issue.description.replaceAll("(?<=\{)([^ ]*)(?=\})","").replaceAll("\{}","")}}

Using this I can cut all formating stuff like {color:#172b4d} that would otherwise end up in an email containing the issue description using Jira automation. 

Like Rudy Holtkamp likes this
0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2024

Hi @Clemens Rätze 

You might need to address the { as "\{\", this ass it is a special char.

Rudy Holtkamp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 1, 2024

Is the second \ needed? Seems like you are escaping the "

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2024

I know, that I have to use the same for trying to replace \\ with nothing.

"\\\\"

Suggest an answer

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

Atlassian Community Events