Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Multiselect field values copied from comment

Dominik Kaźmierski
Contributor
January 12, 2026

Hello Atlassian Community!

I need help with Automation.

 

Here's a scenario - user provides data in a comment in this format:
{
"customfield_XXXXX": ["value 1", "value 2", "value 3"],
"customfield_YYYYY": "value Y",
"customfield_ZZZZZ": "Number",
}

Automation uses {{comment.last.body.substringBetween("\"customfield_XXXXX\": [", "],").trim()}} to populate a variable with data and then adds that data to a custom field.

This works for single select field and a number field, but I struggle to add data to multi select field.

Do you have any suggestion on how it should be built in order to populate customfield_XXXXX with provided data?

 

Thanks!

3 answers

1 accepted

1 vote
Answer accepted
Dominik Kaźmierski
Contributor
January 15, 2026

I received help regarding my issue from Haripriya from Atlassian Team and the automation is working correctly now.

Having a comment formatted as below:
{
"customfield_XXXXX": ["value 1", "value 2", "value 3"],
"customfield_YYYYY": "value Y",
"customfield_ZZZZZ": "Number",
}


Variable = {{comment.last.body.substringBetween("\"customfield_XXXXX\": [", "],").trim().remove("\"")}}
creates correct format which can be used in JSON later on (log action: Variable is value 1, value 2, value 3)

 

Then correct JSON in advanced field editing should look like this:
{
"update": {
"customfield_11177": [
{{#Variable.split(",").trim()}}{"add": {"value":"{{.}}"}}{{^last}},{{/}}{{/}}
]
}
}

There were two main issues: 
#issue.Variable.split(",") was changed to #Variable.split(",")

and .trim() was added to avoid white spaces.

2 votes
Marc -Devoteam-
Community Champion
January 12, 2026

Hi @Dominik Kaźmierski 

This would require advanced field editing options in the edit work item action.

See this KB article; how-to-update-a-select-field-multiple-from-the-content-of-other-fields 

Dominik Kaźmierski
Contributor
January 12, 2026

Hello @Marc -Devoteam- and @Evgenii, thank you for your answers!


I used suggestions from the article, scenario 4 
image.png

And there are some issues.

I created two variables for tests:

Var1 is "Option 1, Option 2"

Var2 is Option 1, Option 2

When using "update" with both Var1 and Var2 I receive error: Additional fields contains invalid 'update'. You can use 'add', 'remove', 'set' or 'edit' for operations.

When is use "fields" instead of "update" the rule is executed successfully but field is being cleared (when values are present) or no options are added (when field is empty). I also double checked - both Option 1 and Option 2 are correct and available in my multiselect list.

Then I tried to use single line custom field instead of variables and I'm receiving Error while parsing additional fields. Not valid JSON. (in both "update" and "fields" configurations and both "Option 1, Option 2" and Option 1, Option 2 input).

Do you have any suggestions on where the problem could be?

Marc -Devoteam-
Community Champion
January 12, 2026

Hi @Dominik Kaźmierski 

Can you please show your automation rule and in detail the parts of the rule?

Evgenii
Community Champion
January 12, 2026

Looks like, you have some problem with array of values.
Try this array, will it update? Haven't tested it by myself, will have time later.


{  "fields": {  "customfield_XXXXX": [  {"value": "Option 1"},  {"value": "Option 2"}  ]  } }

If it will work, we'll think how to split your values from string to separate values 

UPD: No, not working. I'll debug it later

Dominik Kaźmierski
Contributor
January 13, 2026

@Marc -Devoteam- @Evgenii Thank You both for your commitment!

So here's my rule (version which run successfully but wipes data from the field/doesn't set provided values):image.png

{{varOne}} = {{comment.last.body.substringBetween("\"customfield_11177\": [", "],").trim().remove("\"")}}
{{varTwo}} = "{{varOne}}"

{{varThree}} = {{comment.last.body.substringBetween("\"customfield_11177\": [", "],").trim()}}

 

I tested all three variables to try out three different text formats
image.png

Marc -Devoteam-
Community Champion
January 13, 2026

Hi @Dominik Kaźmierski 

As in the documentation , you need to set the action to "add", and not to not "fields"

Dominik Kaźmierski
Contributor
January 13, 2026

Hello @Marc -Devoteam- 
Using "add" instead of "fields" provides error: "No fields or field values to edit for work items (could be due to some field values not existing in a given project)"
I tried it with all the variables and also a text field. Customfield is present on edit screen of the issue and there are no rules in the workflow blocking automation execution.

Marc -Devoteam-
Community Champion
January 13, 2026

Hi @Dominik Kaźmierski 

What is the result if you set the advanced edit to:

{
"update": {
"customfield_XXXXX": [
{{#issue.customfield_XXXXX.split(",")}}{"add": {"value":"{{.}}"}}{{^last}},{{/}}{{/}}
]
}
}

 

Dominik Kaźmierski
Contributor
January 13, 2026

Hello @Marc -Devoteam- 
Using "update" provides error: "Additional fields contains invalid 'update'. You can use 'add', 'remove', 'set' or 'edit' for operations."

Marc -Devoteam-
Community Champion
January 13, 2026

Hi @Dominik Kaźmierski 

This seems the rule actor has no permissions to update the custom field.

Does the rule actor have the correct permissions on the project?

Is the custom field also still on the screen used for edit action?

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 Champions.
January 13, 2026

Hi @Dominik Kaźmierski and @Marc -Devoteam- 

Another possible cause of this symptom is when the JSON is invalid due to a racetrack timing problem.  That is, the smart value expression is not parsed fast enough before the JSON is validated / used in the advanced edit.

The mitigation / way to test for this is:

  • Use the Create Variable action to pre-build the JSON and store it in a variable, perhaps named varJson.  This will force complete evaluation of the expression before the next rule step.
  • Write the variable to the audit log to confirm it contains what you expect
  • Use the variable {{varJson}} in the advanced edit

 

Kind regards,
Bill

0 votes
Evgenii
Community Champion
January 12, 2026

Hi, @Dominik Kaźmierski 

Welcome to the community!

You can achieve your goal using an advanced JSON action in Jira Automation. The key is to structure the JSON payload correctly to update a multi-select custom field based on values from another field.

Here’s a working example:

If you want to populate customfield_10123 (a multi-select field) with values from customfield_10321 (e.g., a text field containing comma-separated values), use this JSON format:

This uses smart values to split the string by commas, iterate over each value, and add it to the multi-select field. The {{^last}},{{/last}} ensures proper comma placement in the JSON array.

{
"update": {
"customfield_10123": [
{{#issue.customfield_10321.split(", ")}}{"add":{"value":"{{.}}"}}{{^last}},{{/last}}
]
}
}

Alternatively, if you're working with Fix Versions or similar system fields, you can use:

{
"update": {
"fixVersions": [
{ "add": { "name": "{{ExistingFixVersion}}" } }
]
}
}

For more guidance, refer to Atlassian’s knowledge base, that earlier shared @Marc -Devoteam-:

https://support.atlassian.com/automation/kb/how-to-update-a-select-field-multiple-from-the-content-of-other-fields/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events