Forums

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

Smart Values in automation

Aditya Sastry
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.
March 17, 2025

Hi,

I've a ask to copy the component value to a custom label field on field change. 

I've used {{issue.components.name}} for the same. However, I've spaces in between the component name and due to which the labels are created separately. I want to replace space with a character to avoid separate labels.

Any pointers?

Thanks in advance

Aditya

2 answers

2 accepted

1 vote
Answer accepted
Vishal Biyani
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.
March 17, 2025

@Aditya Sastry 

Can you try using replaceAll(" ", "")?

{{issue.components.name.replaceAll(" ", "")}}
Aditya Sastry
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.
March 17, 2025

Hi Vishal,

I've already tried it and it doesn't save. Maybe it is not a valid option.

Thanks,

Aditya

Vishal Biyani
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.
March 17, 2025

Can you share the SS of your complete automation including how you are editing the field?

Aditya Sastry
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.
March 17, 2025

I was able to get this to work with a global variable and used the variable to update my custom label field.

 

Screenshot 2025-03-18 at 11.50.25 AM.png

0 votes
Answer accepted
Pasam Venkateshwarrao
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.
March 17, 2025

Hi @Aditya Sastry 

Welcome to the community, while copying the Component values to the Labels list, it's possible to replace the space characters with another character using an "Additional Fields" custom script.

  1. Create your Automation Rule and configure the conditions to trigger the rule.
  2. Add an Edit issue action.Expand the drop-down list Choose fields to set... and select the Labels field.
    1. Add the script below to the Additional fields text field.
      { "fields":
      { "labels": {{issue.components.name.asJsonStringArray.replace(" ","-")}} }
    2. The Edit Issue action will look like this:
      edit issue action

       

     

Hope this helps
Aditya Sastry
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.
March 17, 2025

Thanks Pasam for your response. It gave me a parsing error.

Error while parsing additional fields. Not valid JSON.

can you please help?

Pasam Venkateshwarrao
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.
March 17, 2025

@Aditya Sastry have you used the same script

{
"fields": {
"labels":

{{issue.components.name.asJsonStringArray.replace(" ","-")}}
}
}

Like Vishal Biyani likes this

Suggest an answer

Log in or Sign up to answer