Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Create Options

To create options ….

This document provides instructions on how to use our API to manage a cascade field, including how to read, add, update, and delete options.

To begin, navigate to the “Integration” tab on the app’s configuration page. There, you will find your current API key and the request links for each operation.

image-20240819-151831.pngImage Added

If needed, you can generate a new API key. Please note that generating a new key will immediately invalidate the previous one.

Below are the guidelines for structuring API requests.

Get Options

Returns the options available in a cascade field.

The field is identified by its internal ID and is specified in the body of the request. If a matching field is found its details are returned.

Request

Code Block
languagebash
json{
curl --location --request GET 'https://c0eb368e-1a2d-4395-b903-73c518cc3b1e.hello.atlassian-dev.net/x1/jc-Huc4NYOAffktJrYG4yAzR5r0?apiKey=<YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "fieldId": "customfield_
10xxx
10095"
, "options": [ {

}'

Response

Code Block
languagejson
[
    {
        "id": "1",
        "value": "North America",
        "enabled": true,
        "parentId": "0"
    },
    {
        "id": "2",
        "value": "California",
        "enabled": true,
        "parentId": "1"
    }
]

Create Options

Creates new options in existing fields.

The field is identified by its internal ID and is specified in the body of the request, as well as the new options to be added in the field.

One or more options can be created at a time.

If a matching field is found and te options don’t conflict with existing options IDs, a success message is detailed and returned.

Request

Code Block
languagebash
curl --location 'https://c0eb368e-1a2d-4395-b903-73c518cc3b1e.hello.atlassian-dev.net/x1/RsQfFVidouk1GQguGG1eLZ4Pa8Y?apiKey=<YOUR_API_KEY>' \
--header 'Content-Type: application/json' 
{
\
--data '{
    "
id
fieldId": "
2",
customfield_10095",
    "options": [
        {
            "value": "
USA
South America",
            "
parentId
id": "
1
8",
            "
enabled
parentId":
true
 "0"
        }
    ]
}
'

Response

Code Block
languagejson
{
    "message": "Options processed",
    "created": [
        {
            "
id
value": "
3
South America",
            "
value
id": "
California
8",
            "parentId": "
2
0",
            "enabled": true
        }
    ],
    "skipped": [],
    "failed": []
}

Update Options

000

000

Delete Options

Deletes options from a specified list.

With a field specified in the body, as well a list of options, returns the list of options deleted and a success message.

Options must be formatted as strings in the JSON body.

Request

Code Block
languagebash
curl --location 'https://c0eb368e-1a2d-4395-b903-73c518cc3b1e.hello.atlassian-dev.net/x1/Gm4LRkz3Lixu_RPspke4yZOlMg8?apiKey=<YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
    "fieldId": "customfield_10094",
    "options": [
        "2"
    ]
}'

Response

Code Block
languagejson
{
    "message": "Options processed",
    "created": [
        {
            "value": "South America",
            "id": "8",
            "parentId": "0",
            "enabled": true
        }
    ],
    "skipped": [],
    "failed": []
}