Automation to update custom field with checkboxes

Kenneth Robinson May 17, 2023

I am trying to use the automation to update a custom field that is a checkbox of various options.

The goal in the end is that the custom field may have both options selected

I found the custom field ID from the URL, which is 12500

/secure/admin/EditCustomField!default.jspa?id=12500

When I edit the various options (use blue and green as their option names) as an example, I have the following URLs

t/secure/admin/EditCustomFieldOptions!edit.jspa?fieldConfigId=17069&atl_token=B...5fc_lin&selectedValue=12012
t/secure/admin/EditCustomFieldOptions!edit.jspa?fieldConfigId=17069&atl_token=B...5fc_lin&selectedValue=12013

 

I am assuming that 12013/12012 are the ID for each of the options 

 

When I tire either on of the JSON structures below, the automation returns that the value is not found


{
"update": {
"customfield_12500": [{
"add": {{ "value": "blue" }}
}]
}
}


OR


{
"update": {
"customfield_12500": [{
"add": {{ "id": 12013 }}
}]
}
}

 

In the automation script:

it will look for "blue" in the summary or description, then add blue to the custom field.

it will also look for "green" in the summary or description, then add green to the custom field.

If both blue and green are present then the customfield needs to have BOTH values.

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2023

Try this.

To set one checkbox value

{
"fields": {
"customfield_12500" : [{ "value" : "blue"}]
}
}

 

To set multiple checkbox values

{
"fields": {
"customfield_12500" : [{ "value" : "blue"}, { "value" : "green"}]
}
}
Kenneth Robinson May 25, 2023

Those don't "add" the values to the custom field

I have a two simple if statements

if summary contains blue
then customfield = blue

if summary contains green
then customfield = green

if the summary contains both blue AND green then the customfield should be `blue` and `green`. However, it will only be `green`

 

It seems like the customfield is being overwritten instead of appended.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 25, 2023

As I understand it ithe statement will set only the check box values you specify and clear the rest. So if you want to set multiple check boxes you need to use the statement for setting multiple values in a single statement.

Suggest an answer

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

Atlassian Community Events