Forums

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

Update multi-select dropdown field in compass using mutation in graphQL

Szymon Wosiak
December 10, 2025

hello, maybe a silly one, but graphQL is something completely new to me. I'm able to retrieve some informations using graphQL but overwriting existing data/creating is something i'm stuck in. Can someone please advise about syntax? i just stuckat sth like this:

 

mutation UpdateCustomFieldOptions()
{
compass {
updateCustomFieldDefinition(
cloudId: ID!
definitionId: ID!
input: textInput!)
success
errors {
message
extensions {
errorType
}
}
customFieldDefinition {
definitionId
name
type
# Query the updated options to confirm the change
... on CompassDropdownCustomFieldDefinition {
options {
id # Existing options require their ID
value # The display name of the option
}
}
}
}
}

2 answers

1 accepted

2 votes
Answer accepted
Enrique Serrano Valle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 10, 2025

@Szymon Wosiak are you trying to add options to custom fields so that they would be available in a dropdown?

If so, a mutation like this could work:

mutation AddOptionsToCustomField($input: CompassUpdateCustomFieldDefinitionInput!) {
compass {
updateCustomFieldDefinition(input: $input) {
success
errors {
message
extensions {
statusCode
errorType
}
}
customFieldDefinition {
id
... on CompassCustomSingleSelectFieldDefinition {
name
options {
id
value
}
}
... on CompassCustomMultiSelectFieldDefinition {
name
options {
id
value
}
}
}
}
}
}

With variables such as:

{
"input": {
"singleSelectFieldDefinition": {
"id": "ari:cloud:compass:YOUR_CLOUD_ID:custom-field-definition/YOUR_FIELD_ID",
"createOptions": [
"Option 1", "Option 2", "Option 3", "Option 4", "Option 5",
"Option 6", "Option 7", "Option 8", "Option 9", "Option 10"
]
}
}
}

You can query the results back with:

query GetCustomFieldDefinition($cloudId: ID!, $customFieldId: ID!) {
compass {
customFieldDefinition(query: { cloudId: $cloudId, id: $customFieldId }) {
... on CompassCustomSingleSelectFieldDefinition {
id
name
description
options {
id
value
}
}
... on CompassCustomMultiSelectFieldDefinition {
id
name
description
options {
id
value
}
}
}
}
}

With variables as:

{
"cloudId": "YOUR_CLOUD_ID",
"customFieldId": "ari:cloud:compass:YOUR_CLOUD_ID:custom-field-definition/YOUR_FIELD_ID"
}

Remember that you can also use the GraphQL Explorer in your site to build and test mutations and queries - yoursite.atlassian.net/gateway/api/graphql

Szymon Wosiak
December 11, 2025

amazing, thank You!

0 votes
Tomislav Tobijas
Community Champion
December 10, 2025

Ah, I would the primary way of updating a custom field in Compass is through UI (at least that's the primary supported method.

And yeah, GraphQL mutations can be tricky at first 👀

Like, official support documentation probably doesn't provide a working example or syntax for the updateCustomFieldDefinition mutation in GraphQL.

I did a quick look at Developer community but couldn't find anything specific. However, I believe this question might be better suited for the developer area > meaning, you'd probably get your (faster) answer if you post this question there. @Szymon Wosiak 

Szymon Wosiak
December 10, 2025

thanks for that, problem is that two fields have to have more than 25 options to select so i have no other way but crack it somehow :D

Like Tomislav Tobijas likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events