Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Remove letters from text with automation

Chasovskikh Kirill
Contributor
June 22, 2023

hi !

there is smart value for remove characters

{{issue.summary.remove("x")}}

is there any fast way to remove 3 characters x,y,z with one smart value?

because {{issue.summary.remove("x","y","z")}} return empty value

2 answers

2 accepted

0 votes
Answer accepted
Tim Perrault
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.
June 22, 2023

Hello @Chasovskikh Kirill 

 

You could use replaceAll

 

{{issue.summary.replaceAll("[xyz]", "")}}
Chasovskikh Kirill
Contributor
June 23, 2023

Thank you, Tim! 

It works great for letters. 

Do you know how to use it for symbols like 

{{issue.summary.replaceAll("[ [] ]", "")}}
 

Or maybe how to use it for smart values?

{{issue.summary.replaceAll("[{{test}}]", "")}}

 This smart values returns an error

Tim Perrault
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.
June 23, 2023

Your welcome. We are actually using regex so I don't think we can use a smart value, but we can get rid of brackets.

 

{{issue.summary.replaceAll("[\[\]]", "")}}
0 votes
Answer accepted
Dan Breyen
Community Champion
June 22, 2023

I could be wrong, but it appears you'll have to do it three times.  I don't see another function here Apache String Utils  or other variations of remove that will let you do multiples within one call.

Hope that helps.

Chasovskikh Kirill
Contributor
June 22, 2023

Thank you for the reply!

And do you know, is there any way to remove from text another smart value ? 

f.e. {{issue.summary.remove("{{test}}")}}

Dan Breyen
Community Champion
June 22, 2023

I bookmarked this page for all the Smart Value stuff: Smart Values 

I don't have an exact answer, but it appears you can put 'test' in there and it will take out the whole word.  If you don't put it in quotes, would it do it?

Or try using quote() or trim() to pass in the value?  If you don't get a definite answer, and need to know, I would ask support (support.atlassian.com).

Chasovskikh Kirill
Contributor
June 23, 2023

I don't have an exact answer, but it appears you can put 'test' in there and it will take out the whole word.  If you don't put it in quotes, would it do it?

without quotes it works, but I need to remove from a field a smart value or a variable

Suggest an answer

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

Atlassian Community Events