Hi all,
We are using Automation Lite on an older version of Jira Server. I am trying to copy the value of the OOTB "Component" multi-select field to the OOTB "Team" single-select field. Both fields have the same values, so it exists in each. Can someone assist with the needed JSON for this, as that appears to be the only way.
I reviewed the options here and not able to get it to work:
The Component field could have multiple values and the Team field can only have one. What do you want to do if there are multiple Component values?
Next, please identify the custom field ID for your team field, such as customfield_12345. Once you have found that, please try this expression, assuming there is only one Component value:
{
"fields": {
"customfield_12345": {
"value" : "{{issue.components.first.name}}"
}
}
}
Kind regards,
Bill
Hi @Bill Sheboy
Oh, that was my bad, not thinking of that obvious use case. I need to double check with my user on this.
I am guessing they will say "Can we just add whichever Component was just added to the issue as the Team?" If this is the case, is there a JSON for adding the newest (just added) component to the Team field?
I tested this and the error is 'Error editing issues Key-123 (operation must be string (customfield_15870)). The 'Team" field is unique (type is Team), but behaves like a single select.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use the field change smart value for the added value: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--fieldChange--
I recommend testing to confirm this one works as expected: {{addedfieldChange.values}}
And, my mistake as you are using one of the built-in Team fields. Please try this, assuming the trigger is Issue Field Changed for Components and only one value was added:
{
"fields": {
"Team": "{{addedfieldChange.values}}"
}
}
If that does not work with "Team", please use the "customfield_15870" in the JSON.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bill,
When I changed the JSON to yours above using "Team" or "Component" is not EMPTY, It is successful, but nothing changes.
I have limited options on the trigger (due to the "Lite" version). My trigger is "Issue Updated" with JQL condition = "Component" is not EMPTY. This triggers the rule as expected.
- I then tried a new trigger of "Issue Property Updated" and {{issue.components.name}} but could not get it to trigger.
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.