Automation - copy component field

Dd
Contributor
September 12, 2024

Hi,

I created a multi select custom field MyComponents where the values are all the values in the components.

How can I use smart values and automation and copy the value of the component into MyComponent.

The following didn't work:

{ "fields": { "customfield_10272": { "value": "{{issue.components.name}}"} } }

Audit log posted:

TASK-450 (Specify the value for MyComponents in an array (MyComponents))

 

What am I doing wrong?

Thanks

2 answers

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
September 12, 2024

Hi @Dd 

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

With components, there can be zero-to-many values.  Please use the array syntax for your JSON to copy those to a multiple-selection, option field: https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Multi-select-custom-field

Then you may try iterating the values to produce a dynamic JSON expression for the issue edit: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#Combined-function-examples

Kind regards,
Bill

0 votes
Manoj Gangwar
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2024

Hi @Dd 

You may try

[
{{#issue.components}}{{name}}{{^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