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.
...
Expand | ||
---|---|---|
| ||
{ |
...
Table Sum
Method:
Status | ||||
---|---|---|---|---|
|
...
Expand | ||
---|---|---|
| ||
{ |
...
Table configuration
Method:
Status | ||||
---|---|---|---|---|
|
This request can be used to get information about the configuration of a STAGIL Tables custom field. This means you will get information like id, default value, column type, max/min values, read-only etc., for each row in your a table: .
...
Code Block |
---|
https://JiraURL/rest/stj/1.0/api/table/fields/{{fieldConfigId}} |
...
You can retrieve the field configuration ID from the url of the STAGIL Tables Configuration page:
...
Example URL:
https://yourjiraURL.com/rest/stj/1.0/api/table/fields/23804
Response: An array which contains configuration information about each row id per index step.
Expand |
---|
Expand | ||
---|---|---|
| ||
[ |
GET FIELD SUM
If you want to get the sum of just one field you can use the following request url:
...
Expand | ||
---|---|---|
| ||
|
Expand | ||
---|---|---|
| ||
GET CSV FILE
You can also get a csv export of your table by using REST API:
...
Table in CSV format
Method:
Status | ||||
---|---|---|---|---|
|
Returns table values in a CSV format
Code Block |
---|
https:// |
...
JiraURL/rest/stj/1.0/api/table/{{fieldConfigId}}/{{issueIdOrKey}} |
...
Response: you will receive the data of your table in csv format (separator = comma)
...
/COMMA/csv |
Expand | ||
---|---|---|
| ||
Text,Number ,Select List 1,Date,Issue picker ,Child select,User Picker |
UPDATE ROW
Method:
Status | ||||
---|---|---|---|---|
|
When you want to change certain rows of your table, you need to use the following API call configuration:
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!
Create row
Method:
Status | ||||
---|---|---|---|---|
|
...
Navigate to Settings () > Issues > Custom fields under the Fields section
Click on the More (⋯) icon to the right of the custom field you are obtaining the ID
The next page will list all the context for the current table field. Click ‘Edit STAGIL Tables and Checklists Configuration’.
The URL of the next page will be quite long. Closer to the end you will find the fieldConfigId value.
...