Copy Multiple Choice Field Values in Jira Service Management Cloud Using Automation
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Learn how to create a new work item in another Space with Select List (multiple choices) fields. There is an issue when using the automation to copy multiple-choice field values from a Jira Service Management Space to a Jira Work Management Space.
Smart values convert into a single item instead of a list. For example, products (a, b) are converted to a single item "a,b" (rather than "a" and "b" ). This then doesn't match any options and leaves the receiving multiple-choice field blank.
You can achieve this by using Regular Expressions (regex) to parse through the list. This solution can also be used as a practical workaround for the bug AUTO-93 - Using smart values to copy a multiple-choice field to a team-managed or discovery project does not work.
Use this pattern when an Automation Flow copies a Select List (multiple choices) value from a Jira Service Management Cloud Space into another Space and the receiving field is blank because the source values were converted into one comma-separated item.
Do not treat this as a general-purpose field-migration recipe. Confirm that the source and target fields are both multiple-choice fields and that the target options match the values being copied.
Environment
Jira Service Management Cloud | Jira Work Management Cloud | Jira Product Discovery.
Solution
Automation Rule using regex
Go to your Space Settings > Automation and start a new rule with the following components:
Trigger: Select the trigger that meets your design requirements.
Then: Add an Action: Create variable - Give the variable a name and set the smart value of the multiple choice field.
{{#issue.customfield_id}}{"value": "{{name}}"},{{/}}Multiple choice fields often have more than one value. Use the # symbol to iterate through those values and store them as a variable.
When using #, you must close the expression with {{/}}.
Helpful Links:
Then: Add an Action: Create Work Item.
Select your target Space and Work Item Type.
Select Copy From for the Summary and Description field.
Select the Choose fields to set dropdown.
Select the Custom field to which you want to copy the multiple-choice field.
More options, using JSON to set values on the target Space field.
{ "fields": { "customfield_10486": [{{ProductVar.match("(.*)(?=,)")}] } }The use of regex is needed to parse through the values as a list and store them in the target project's multiple-choice field properly.
Verify the copy
Test with a source field containing one selected value.
Test with a source field containing multiple selected values.
Confirm that the target field contains separate options rather than one comma-separated value.
If the target field remains blank, verify the target option names and custom-field ID before changing the regex.
Was this helpful?