Forums

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

Automation to add a value in a custom field (multiple choises) without replacing existing values

Maria Savignano April 30, 2024

I am creating an automation so that when a task is created in a software project, if that task is linked to an Epic and Initiative, it adds a value in a custom field included in the Epic and Initiative. This field accepts multiple values, however, the automation replaces all values with the one I asked it to add.

How can I make it so that it doesn't replace it but adds the value instead?"

THEN Edit value.png

1 answer

1 accepted

1 vote
Answer accepted
Bhanu KN
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 Leaders.
April 30, 2024

Hi @Maria Savignano

Hope you are doing well. 

You can use JSON to append the values instead of the Set option

In the Edit action,> More options> Add Json as shown under Additional Fields: 

Screenshot 2024-04-30 163215.png

{
"update": {
"customfield_10279": [{
"add": { "value": "Option 3" }
}]
}
}

Replace 10279 with your custom field ID; you can find it in URL while editing the custom field, other ways are listed here.

and Option 3 with your option value.

Hope this helps :)

 

Regards,

Bhanu

 

Maria Savignano May 1, 2024

Hello Bhanu

Yes it worked! Thank you so much for your help. 

 

Regards,

Maria Grazia Savignano

Maria Savignano May 28, 2024

Hi @Bhanu KN 

Can you help me again? I'm creating a new, slightly more complex automation. I need the automation to add a value, but I won't be able to specify the exact value the automation needs to add.

I added the following JSON:

{
"update": {
"customfield_10258": [
{
"add": {
"value": "{{issue.fields.customfield_10258.value}}"
}
}
]
}
}

But the automation fail to add the value. Am I adding the wrong JSON?

Basically, I need it to add the value of customfield_10258 from the Epic to the same field in the Initiative. The problem is that sometimes the value is already there or (since the field is multi-select) some of the options already appear in the Initiative. Therefore, I need it to add only the missing value.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events