/
Cascading Select - Options API

Cascading Select - Options API

On this page


Cascading Select API settings

You’ll find the API setting below the fields table on the admin dashboard (Jira Settings > Apps > Awesome Custom Fields).

1. Enable API

Enable the API by toggling the switch to 'on' on the right. If you have multiple Cascading Select fields, you can use the API for all of them.

 

image-20240701-070545.png

 

 

2. Create token

After enabling the API, you’ll find a unique URL for your instance and a button to create a custom token for authentication.

 

image-20240701-071201.png

 

 

 

3. Manage token

You can now copy the token using the icon on the left. To revoke it, click the trash can icon on the right and create a new token.

 

 


Retrieve parameters

To use the Cascading Select API you need four parameters and the actual options data

Some browsers have a bug that causes an error when copying a value. If this happens, please click next to the copy button to focus on the current window, then try copying again. Alternatively, you can manually select the text and copy it.

1. URL and token

Copy the URL and token using the buttons on the left before the input field.

 

 

 

2. Field Id

Navigate to the Cascading Select field you want to populate via API, click the gear icon on the right, and select 'Copy field id'. The field ID will look something like 'customfield_123456'.

 

 

 

 

3.1 Context configuration id

To retrieve the context id. Navigate to the field configuration.

 

 

Select the context you want to update the options for.

Copy the configuration id by clicking the button on the top right.

 


REST API documentation

The API is inspired by the Atlassian Cloud field options API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-group-issue-custom-field-options

GET Get Cascading Select options

Returns a list of all Cascading Select options for a context.

Request

Header

authorization: string (token)

Query Parameters

fieldId: string requried
configurationId: string requried

Response

200 OK

Returned if the request is successful

interface CascadingSelectOptionData { id: string; name: string; children?: string[]; }

 

Example

const response = await fetch(`${url}?fieldId=${fieldId}&configurationId=${configurationId}`, { method: "GET", headers: { authorization: `${token}`, accept: "application/json", }, }); console.log(await response.json());

 

[ { "id": "1", "name": "Option 1", "children": [ "3" ] }, { "id": "3", "name": "Option 1.1", "children": [ "5" ] }, { "id": "5", "name": "Option 1.1.1", "children": [] }, { "id": "6", "name": "Option 2", "children": [] } ]

 


POST Create Cascading Select options

Creates new Cascading Select options and returns a list of all options for a context.

Request

Header

authorization: string (token)

Query Parameters

fieldId: string requried
configurationId: string requried
saveInStorage: boolean optional

Body

 

Response

200 OK

Returned if the request is successful

 

413 Configuration is too big

You have too many options. If you haven’t already set the saveInStorage parameter, you may try to rerun your command adding &saveInStorage=true.

Please note, that this setting won’t work with JSM

500

Please read the error message or contact support

Example

 

 


put Update Cascading Select options

Updates Cascading Select options and returns a list of all options for a context.

Due to technical restrictions, this call won’t work in a browser (https://ecosystem.atlassian.net/browse/FRGE-1434 )

Request

Header

authorization: string (token)

Query Parameters

fieldId: string requried
configurationId: string requried
saveInStorage: boolean optional

Body

Response

200 OK

Returned if the request is successful

413 Configuration is too big

You have too many options. If you haven’t already set the saveInStorage parameter, you may try to rerun your command adding &saveInStorage=true.

Please note, that this setting won’t work with JSM

500

Please read the error message or contact support

Example

 



Technical details

The API is implemented using the Forge webtrigger module, which generates a URL accessible from outside the cloud context.

 


Related content