I'm trying to copy values from a custom field and add them to the Labels field on the same issue. The custom field type is: Select List (multiple choices)
Trigger
Value changes for Custom Field (any changes)
Create variable
Variable name: customField
Smart value:
{{issue.customfield_12345.value.replace(" ", "_")}}This replaces spaces with underscores because the custom field allows values with spaces but the Labels field doesn't.
Edit issue fields
More options:
{
"fields": {
"labels": [
{{#customField.split(", ")}}
{ "add": "{{.}}" }
{{^last}},
{{/}}
{{/}}
]
}
}Based on these threads I was expecting this to split the value into comma separated strings, then loop adding each one to the labels field. However, the audit log returns the error:
Error editing issues ID-1234 (Specify an string at index 0 for labels (labels))
Any thoughts appreciated - many thanks!