Hey,
I have an advanced form that I would like to use to trigger a change in a multiple choice field. This change should not impact existing choices in the field.
So if condition is true the my multiple choice field has a new selection added to it.
Any ideas how I can actually achieve this. It should be possible with simple condition & "Edit work item" action, but my field is always updated but all previous choices are updated too.
Is this even possible? I am working in Jira cloud and not JSM.
Thank you in advance for the help.
Hi @csenge_virag_kiss and welcome to Atlassian Community!
Please check Advanced field editing using JSON.
The reason your existing choices are being overwritten is because you’re using fields (set).
For multi-select fields you must use update with add / remove / set.
Here’s a short example showing all options for a multi-select custom field
(customfield_12345):
Add (keeps existing values)
{
"update": {
"customfield_12345": [
{ "add": { "value": "New Option" } }
]
}
}
Remove (removes only one value)
{
"update": {
"customfield_12345": [
{ "remove": { "value": "Old Option" } }
]
}
}
Set (replaces everything)
{
"update": {
"customfield_12345": [
{ "set": [
{ "value": "Option A" },
{ "value": "Option B" }
]}
]
}
}
Clear field completely
{
"update": {
"customfield_12345": [
{ "set": [] }
]
}
}
Are you just trying to append a value to your multiple choice field?
If so, in your automation rule, you should be able to select ADDREMOVE instead of SET or COPY.
By selecting ADDREMOVE, the automation will prompt you to pick which value you are adding (or removing).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @csenge_virag_kiss -- Welcome to the Atlassian Community!
Without seeing your entire rule and audit log details for context...
You will likely need to use list iteration to build a dynamic JSON expression to update a multiple-select option field, adding the new values. To reduce the chance of racetrack timing errors, I recommend first creating the JSON and storing it with the Create Variable action, and then use the variable in the Edit Work Item action.
Please try that, and if you run into challenges, please post the following:
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.
Hi,
Yes — this is possible in Jira Cloud, but the issue is that the Edit issue / Edit work item action replaces the entire multi-select field value, rather than appending to it. That’s why your existing selections are being overwritten.
To add a new option without removing the current ones, you need to append to the field using Advanced JSON editing in the automation rule.
How to do it:
Add your condition as usual
Add Edit issue action
Switch to More options (Advanced JSON)
Use the update operation instead of fields
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.