Forums

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

Smart Value string manipulation returning blanks

Jamie Wilson August 4, 2023

I'm trying to use an automation to set an issue label to an extracted string from another custom field. 

I'm trying to set it as a smartvalue, when I test this: {{fields.cf[10358]}} it provides me with the complete string. 

But the issue is it has spaces in it so cannot be set as a label. When I try any of the following it returns the smartvalue as completely blank!

{{fields.cf[10358].substring(5,10)}}

{{fields.customfield_10358.trim()}}

{{fields.customfield_10358.replace(" ","_")}}

{{fields.customfield_10358.format(“#”).substring(5,10)}}

Any suggestions?

1 answer

1 accepted

Jamie Wilson August 7, 2023

Thanks! 

Went through the links and found one that worked. Set up a variable with this:

{{issue.customfield_10358.value.remove(" -").replace(" ","_")}}

Then 'Added' label using the variable name. 

Like Ste Wright likes this

Suggest an answer

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

Atlassian Community Events