Versions Compared

Key

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

You can use Jira's REST API to view, create or change data within the STAGIL Table field. The following section will help you to set up your API requests.

...

  • URL: https://yourjiraURL.xyz/rest/stj/1.0/api/table/data/customField/{{customFieldId}}/issue/{{issuekey}}/row/row/ID

  • Headers:

    • Your type of authorization

    • Content-Type: application/json;charset=UTF-8;

    • Accept: application/json;

  • You can get the row ID from the GET request, looking at the "id" of the row you want to modify.

  • URL example: http://localhost:8080/rest/stj/1.0/api/table/data/customField/25504/issue/KEY-4/row/123

  • With the GET request you can also see all the available fields and the structure of the table data. When you have drop-down, text or user columns, you only need the "field-1" part of the body. The "field-1-html" or "field-1-name" is not needed and will be added automatically. At the end of the body you don't need to add the custom field ID and the issue ID.

  • Example body: {"field-1": "Customer 7", "field-3": [2], "field-5": "anorth", "field-6": [8]}
    This structure is simply retrieved from the GET request and you only modify the fields that you want to change. In this example, field-1 is a text field, field-3 and field-6 are select lists and field-5 is a user picker.

  • For select list it is possible to use just "field-1-name": [“option1“, “option2“].

  • Please make sure to include all the used columns of your row in your PUT request. Missing columns will be overwritten with empty values!

POST Request - CREATE ROW

...

Code Block
http://yourjiraURL/rest/stj/1.0/api/table/fieldConfig/{{fieldConfigId}}/field/{{fieldId}}/options
Expand
titleVariables

{{fieldConfigId}} - field ID of the table custom field.

{{fieldId}} - ID of the select list column

view-file
nameInvalid file id - 22ff9878-652c-41e3-8d48-712b2e4cece7
Expand
titleResponse: 200

[
{
"disabled": false,
"id": 105,
"optionValue": "Option 1",
"orderPosition": 0
},
{
"disabled": false,
"id": 106,
"optionValue": "Option 2",
"orderPosition": 1
},
{
"disabled": false,
"id": 107,
"optionValue": "Option 3",
"orderPosition": 2
}
]

It is also possible to get a single option by id

Code Block
http://yourjiraURLyourJiraURL/rest/stj/1.0/api/table/fieldConfig/{{fieldConfigId}}/field/{{fieldId}}/options/{{optionId}}

...

Expand
titleResponse: 200

{
"disabled": false,
"id": 107,
"optionValue": "Option 3",
"orderPosition": 2
}

Create new option

Method:

Status
colourGreen
titlePOST

Allows to create a new select list option with the following configurations:

  • enabled / disabled (for selection)

  • order position in the select list drop-down

  • include the option in the cascading select hierarchy, i.e. set the option as a dependent from an option in another (parent) select list column.

Code Block
https://yourJiraURL/rest/stj/1.0/api/table/fieldConfig/{{fieldConfigId}}/field/{{fieldId}}/option
Expand
titleBody example
Code Block
{
        "dependentOptions": "optionid", // is not mandatory
        "disabled": false, // is not mandatory
        "optionValue": "Option name", // required
        "orderPosition": 0 // is not mandatory
    }

Expand
titleResponse: 200
Code Block
{
    "disabled": false,
    "id": 117,
    "optionValue": "Option 4",
    "orderPosition": 3
}

Update an option

Method:

Status
colourGreen
titlePUT

Allows to update the configuration of an existing option

Code Block
https://yourJiraURL/rest/stj/1.0/api/table/fieldConfig/{{fieldConfigId}}/field/{{fieldId}}/option/{{optionId}}
Expand
titleBody example
Code Block
{
        "dependentOptions": "optionid", // is not mandatory
        "disabled": false, // is not mandatory
        "optionValue": "Option name", // required
        "orderPosition": 0 // is not mandatory
    }
Expand
titleResponse: 200
Code Block
{
    "disabled": false,
    "id": 107,
    "optionValue": "Option name updated",
    "orderPosition": 0
}

Variables