REST API Requests

REST API Requests

Variables

:customFieldID is a unique ID of a STAGIL table. See Table ID for details.

:rowID - use GET Table call to retrieve the row ID (e.g. "id": 146839)

:fieldId - Table column ID

:issueIdOrKey requires an issue ID or issue key of a particular Jira issue.

:customfieldConfigID or :customFieldConfig - table configuration ID number. To get the ID, go to the ‘Table Configuration’ page, select a table and click Manage in the ‘Actions’ menu. Then see the ID listed in the context:

image-20240416-154644.png
Field Configuration ID

Table

Get table

Returns table rows and their values.

Method: GET

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey

Variables: :customFieldId, :issueIdOrKey

{ "issueId": 11479, "issueKey": "SD-2", "data": [ { "orderPosition": 0, "id": 146839, // row ID "field-2918": "true", "field-2198": "Review progress", "field-2198-html": "<p>Review progress</p>", "field-2199": [], "field-2199-name": [], "field-2232": "2023-02-02", "field-2853": "5f27f8656c9d820022d941f0", "field-2853-name": "STAGIL Tables" }, { "orderPosition": 1, "id": 150495, "field-2918": "false", "field-2198": "Set stategy meeting", "field-2198-html": "<p>Set stategy meeting</p>", "field-2199": [], "field-2199-name": [], "field-2232": "2023-03-01", "field-2853": "5f27f8656c9d820022d941f0", "field-2853-name": "STAGIL Tables" }, { "orderPosition": 2, "id": 150496, "field-2918": "false", "field-2198": "Lead follow-up", "field-2198-html": "<p>Lead follow-up</p>", "field-2199": [], "field-2199-name": [], "field-2232": "2023-02-27", "field-2853": "5f27f8656c9d820022d941f0", "field-2853-name": "STAGIL Tables" }, { "orderPosition": 3, "id": 150497, "field-2918": "true", "field-2198": "New sales braintorm", "field-2198-html": "<p>New sales braintorm</p>", "field-2199": [], "field-2199-name": [], "field-2232": "2023-02-27", "field-2853": "5f27f8656c9d820022d941f0", "field-2853-name": "STAGIL Tables" } ] }
Table in issue view

The GET response contains output-only fields such as:

  • field-xxxx-name for Select List, Status, and User Picker columns

  • field-xxxx-html for Text columns

These fields are included for display/readability purposes only and are not supported in POST/PUT/PATCH requests (500 Internal Server Error).

Therefore, modifications to the GET response body are required before reusing it in create/update requests. Only fields in the field-xxxx format with raw values should be sent in create/update operations.

Get table filtered by columns

Returns table rows that match the specified filter criteria.

Method: post

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/{customFieldId}/issue/{issueIdOrKey}/filter

Variables: :customFieldId, :issueIdOrKey

Fill out the request body with column filters using the following JSON snippet (specified for each column type):

Text Column

Returns rows where the value matchers the specified text.

{ "field-{TextColumnId}": { "text": "starts with this" } }

Number Column

Returns rows where the value is within the specified range.

{ "field-{NumberColumnId}": { "values": { "from": "10", "to": "100" } } }

Decimal Number Column

{ "field-{DecimalNumberColumnId}": { "values": { "from": "1.5", "to": "9.9" } } }

Date Picker Column

{ "field-{DatePickerColumnId}": { "dates": { "from": "2024-01-01", "to": "2024-12-31" } } }

Select List Column

{ "field-{SelectListColumnId}": { "options": [ "optionId1", "optionId2" ] } }

Status Column

{ "field-{StatusColumnId}": { "options": [ "optionId1" ] } }

Issue Picker Column

{ "field-{IssuePickerColumnId}": { "options": [ "PROJ-1", "PROJ-2" ] } }

User Picker Column

{ "field-{UserPickerColumnId}": { "options": [ { "value": "UserId1" }, { "value": "UserId2" } ] } }

Checkbox Column

{ "field-{CheckboxColumnId}": { "options": "true/false" } }

Formula Column

{ "field-{FormulaColumnId}": { "values": { "from": "0", "to": "500" } } }

Get multiple tables

Returns tables from an array of issues.

Method: GET

API call:

https://apps.stagil.com/stjc/rest/stj/2.0/api/table/customField/{customFieldId}?nextPageToken={token}&jql={jql_query}

Variables:

  • customFieldId - The ID of the Table field.

  • nextPageToken - Token for retrieving the next page of results in paginated responses. Leave empty for the first request (returns first 25 issues), then use the token from the previous response for the next batch.

  • jql - JQL query to filter which issues are searched for tables.

Update table

https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey

Method: PuT

Description: replaces current table with values from the body

Variables: :customFieldId, :issueIdOrKey

Fill out the body of the request with values for the new row. Use the JSON snippet below as an example.

Leave the body empty to clear the table

[

{

"orderPosition": 0,
"id": 82736,
"field-683": "false",
"field-669": "1test",
"field-677": 0.0,
"field-670": 0,
"field-671": "",
"field-675": "true",
"field-682": 0.00
}

]

 

Clone table

Tables can be cloned using one of the following calls. Please refer to the call conditions to determine the best one for your use case.

A general rule for both calls: a target table must be empty.

Clone single table only

Method: POST

Description: clone table values between 2 issues.

Condition: an issue with a target table should not have any other tables in issue view.

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/clone/customField/:customFieldId/issue/:fromIssueIdOrKey/to/:toIssueIdOrKey

Variables:

:customFieldId = Table ID

:fromIssueIdOrKey - a key or ID of the source issue to copy table values from

:toIssueIdOrKey - a key or ID of the target issue to copy table values to.

Clone one or more tables

Method: POST

Description: clones all tables that are configured for the current issue.

If the target table is not empty, the cloning process will skip it. This means that only empty tables will receive cloned values. Therefore, this call is useful for cloning a single table when there are multiple tables configured, as long as the tables to be skipped are not empty.

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/clone/issue/:fromIssueIdOrKey/to/:toIssueIdOrKey

Variables:

:fromIssueIdOrKey - a key or ID of the source issue to copy table values from

:toIssueIdOrKey - a key or ID of the target issue to copy table values to.

Export table CSV

Method: GET

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/:customFieldConfig/:issueIdOrKey/:delimiter/csv

Variables::customFieldConfig,

:delimiter - used for a CSV table export. Use comma or semicolon text values to specify delimiter.

For example,

https://apps.stagil.com/stjc/rest/stj/1.0/api/table/123/ABC-2/semicolon/csv

Checklist;To-do;Status;Status id;Due Date;Assignee;Assignee id
true;Review progress;Done;4861;2023-02-02;STAGIL Tables;5f27f8656c9d820022d941f0
false;Set stategy meeting;In progress;4860;2023-03-01;STAGIL Tables;5f27f8656c9d820022d941f0
false;Lead follow-up;In progress;4860;2023-02-27;STAGIL Tables;5f27f8656c9d820022d941f0
true;New sales braintorm;Done;4861;2023-02-27;STAGIL Tables;5f27f8656c9d820022d941f0

Table example

Columns

Returns details about table columns configuration

Method: GET

API cal: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/fields/:customFieldConfigId

Variables::customFieldConfigId

[ // Checklist column configuration { "id": 2918, "defaultValue": "false", "fieldName": "Checklist", "fieldType": "Checkbox", "formula": "Checklist", "mandatory": false, "sumNumber": false }, // Simple text column configuration { "id": 2198, "defaultValue": "", "fieldName": "To-do", "fieldType": "Simple Text", "formula": "To-do", "mandatory": false, "sumNumber": false }, // Select List column configuration { "id": 2199, "defaultValue": "", "fieldName": "Status", "fieldType": "Select List", "formula": "Status", "mandatory": false, "maxSelection": 0, "sumNumber": false, "fieldOptions": [ { "id": 3995, "optionValue": "Not started " }, { "id": 4860, "optionValue": "In progress" }, { "id": 4861, "optionValue": "Done" } ] }, // Date column configuration { "id": 2232, "defaultValue": "", "fieldName": "Due Date", "fieldType": "Date", "formula": "Due Date", "mandatory": false, "sumNumber": false }, // User picker column configuration { "id": 2853, "defaultValue": "", "fieldName": "Assignee", "fieldType": "User Picker", "formula": "Assignee", "mandatory": false, "sumNumber": false } ]
Table configuration

Sums

Table sum

Returns separate sums of values within all table columns

Method: GET

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/sum/customField/:customFieldId/issue/:issueIdOrKey

Variables: :customFieldId, :issueIdOrKey

{ "field-2920": 3, "field-2921": 1840, "field-2922": 2830.00 }

Table sum filtered by columns

Returns column sum for rows matching the specified filter criteria.

Method: post

API call:

https://apps.stagil.com/stjc/rest/stj/1.0/api/table/sum/customField/{customFieldId}/issue/{issueIdOrKey}

Variables: :customFieldId, :issueIdOrKey

The request body uses the same filtering structure as the GET table filtered by columns endpoint.

Column sum

Retrieved the sum of all values in the number column

Method: GET

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/sum/customField/:customFieldId/issue/:issueIdOrKey/field/:fieldId

Variables: :customFieldId, :issueIdOrKey, :fieldId

2830.00

Value is returned for the last Formula column.

Table row

Create new row

Method: Post

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey

Variables: :customFieldId, :issueIdOrKey

Fill out the body of the request with values for the new row. Use the JSON snippet below as an example.

{ "field-2918": "false", "field-2198": "New task", } // field-$id = column id. Use GET Table call to find out column's IDs.

 

Update existing row

Method: PUT

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey/row/:rowId

Variables: :customFieldId, :issueIdOrKey, :rowId

Fill out the body of the request with new values for the row. Use the JSON snippet from the previous call as an example. If some column values are not specified in the request body, the corresponding cells will be overwritten with null value.

Update specific table cells in the existing row

Method: PATCH

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey/row/:rowId

Variables: :customFieldId, :issueIdOrKey, :rowId

Fill out the body of the request with new values for the row. Use the JSON snippet from the previous call as an example. Only the fields specified in the request body will be updated, while all other values in the row will remain unchanged.

Delete row

Method: Delete

API call: https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/:customFieldId/issue/:issueIdOrKey/row/:rowId

Variables: :customFieldId, :issueIdOrKey, :rowId

Increased REST API rate limit from 10 requests per second to 1000 requests per minute to support high-volume automation scenarios.