Forums

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

Components shadow labels

Dd
Contributor
June 30, 2025

Hi,

I would like to have a custom field that gets its values from the project component.

Is there a way to do so other than creating a multi select field with all the values?

If there isn't one, how can I use smart values in automation to copy the components values to the custom field and vice versa?

Thanks

Dd

3 answers

1 vote
Dilip
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 30, 2025

Hi @Dd 

If your custom field is text field use below smart value:

{{issue.components.name.join(", ")}}

If your custom field is a multi-select field:

{
"fields": {
"customfield_XXXXX": [{{#issue.components}}{{#if notLast}}"{{name}}",{{else}}"{{name}}"{{/if}}{{/}}]
}
}

Replace customfield_XXXXX with your custom field's ID.

Dd
Contributor
June 30, 2025

I'll try that.

Thanks

Dd
Contributor
June 30, 2025

I get the following error (I replaced the XXXXX with the field number)

 

Error while parsing additional fields - Closing tag (if) does not match opening tag (if notLast)

 

How do I correct that?

Thanks 

0 votes
Kseniia Trushnikova
Community Champion
July 7, 2025

Hey @Dd,

Try this one :)

{
"fields": {
"your_multi_field": [{{#issue.components}}{"value":"{{name}}"}{{^last}},{{/}}{{/}}]
}
}
Dd
Contributor
July 8, 2025

Tried the following:

{
"fields": {
"issue.customfield_10272": [{{#issue.components}}{"value":"{{name}}"}{{^last}},{{/}}{{/}}]
}
}

I used the customfield defintion and got the following error in the Audit Log:

 

Screenshot 2025-07-08 131258.png

Kseniia Trushnikova
Community Champion
July 8, 2025

@Dd, hm... Is the custom field ID correct? Try to use the name of the field instead.

Here's my rule as reference:

Screenshot 2025-07-08 at 12.21.48.png

"Multi" is the name of my test multi-select field. The rule runs successfully.

Dd
Contributor
July 8, 2025

The automation ran but the field wasn't updated.

{
"fields": {
"Proposed Components": [{{#issue.components}}{"value":"{{name}}"}{{^last}},{{/}}{{/}}]
}
}

Could it be that I miss the "issue" prefix (though in your example it doesn't appear)? that's why I used the custom notation.

If I need to add it, how do u do that with a custom field that is constructed from 2 words?

Thanks

 

Kseniia Trushnikova
Community Champion
July 8, 2025

@Dd, the rule an without any errors in the log?

Maybe the Components field is simply empty in the ticket you're using for testing? In the rule, you copy all the components from the ticket to the Proposed Components field, so if there are no components in the ticket, your custom field won't be updated.

As for the prefix for "Proposed Components", you don't have to use "issue", but if you want, you can use "issue.Proposed Components". "Proposed Components" and "issue.Proposed Components" mean the same here.

Dd
Contributor
July 8, 2025

@Kseniia Trushnikova 

I look at a filter that shows both fields, so I know that the Components field does have a value.

The Proposed Components has a value too - I want it to change (I assume that's not the issue).

The audit log just states that no changes were made.

I can add the issue but if you say it's redundant - then I won't. 

 

  

0 votes
Gor Greyan
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 30, 2025

Hi @Dd
I saw that you faced an error during the parsing.
Check the following one.

{
"fields": {
"customfield_XXXXX": [
{{#each issue.components}}
"{{name}}"{{#unless @last}},{{/unless}}
{{/each}}
]
}
}

Dd
Contributor
June 30, 2025

Will do - thanks

 

Dd
Contributor
June 30, 2025

Still getting that:

Error while parsing additional fields - Closing tag (unless) does not match opening tag (unless @last)

Gor Greyan
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 30, 2025

@Dd
Thanks for the answer.

{
"fields": {
"customfield_XXXXX": [
{{#each issue.components}}
"{{name}}"{{#if @last}}{{else}},{{/if}}
{{/each}}
]
}
}

Kindly ask you also try this one.

Dd
Contributor
July 1, 2025

Still fails

Screenshot 2025-07-01 153753.png

Gor Greyan
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.
July 1, 2025

@Dd
Thanks for the feedback.

Let's also try this one.

{
"fields": {
"customfield_XXXXX": [
{{#each issue.components}}"{{name}}"{{#unless @last}}, {{/unless}}{{/each}}
]
}
}

Dd
Contributor
July 3, 2025

Still error:

Error while parsing additional fields - Closing tag (unless) does not match opening tag (unless @last)

Gor Greyan
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.
July 3, 2025

{
"fields": {
"components": [
{{#each issue.customfield_XXXXX}}"{{.}}"{{#unless @last}},{{/unless}}{{/each}}
]
}
}

Hey @Dd

Thanks for the feedback.

Please try this one, I have added {{.}}, which is used when iterating over a list of strings instead of objects

Dd
Contributor
July 7, 2025

Same issue :-(

Error while parsing additional fields - Closing tag (unless) does not match opening tag (unless @last)

Gor Greyan
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.
July 7, 2025

{
"fields": {
"components": [
{{#each issue.customfield_XXXXX}}
"{{this}}"{{#unless @last}},{{/unless}}
{{/each}}
]
}
}
Hi @Dd

Please try this one :( 

Dd
Contributor
July 8, 2025

Same message still :-( 

Error while parsing additional fields - Closing tag (unless) does not match opening tag (unless @last)

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