I'm looking to duplicate the value from the OOTB Component field to a custom text field using automation rules. However, the drop-down for "Field to copy value from" does not list the OOTB Component field. Any thoughts on this?
Hey @Ami Heller
The "copy from" selection will only allow you to copy the same type of value (e.g. I can copy other text fields but not the label field). Components are a special Jira field, there are multiple values associated with a component.
To copy the value from a component to a plain text field you will need to use a smart value. The {{issue.components.name}} will list all the current components as plain text.
This is what your rule might look like:
This will appear as a comma separated list in the field:
Documentation for reference: https://support.atlassian.com/jira-software-cloud/docs/smart-values-general/
Hope that helps!
- John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ami Heller -- Welcome to the Atlassian Community!
There are a few ways to do this copy, depending upon the outcome you want to achieve and the type of your destination, custom field.
If you want to just copy to a text field, a separated values list, you could type this smart value into the field: {{issue.components.name}}
To get that smart value in the field source, just start typing the smart value, it will appear below the field, and you may select it when done so it is used.
If instead your destination field is defined, multiselect field, you will probably need to use advanced edit with JSON to edit the field: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/
And...if neither of those methods work, please consider posting an image of your audit log and describe what you observing happening when the value does not copy. Thanks!
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, Bill! The simple copy to a text field was what I was looking for. Appreciate your help! 🙏
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I had a similar issue (wanted to copy Components into the other dropdown) I will add my solution (based on JSON edit which Bill mentioned):
{
"fields": {
"customfield_xxxxx" : {{issue.components.name.asJsonObject("value").asJsonArray}}
}
}
It will copy all of the components into the other custom multi-select field. Note here, your custom field has to contain the same values as you have defined as components.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Omg, Michal, thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for this Michal!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.