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

Get multiple tables

Returns tables from an array of issues.

Method: GET

API call:

https://apps.stagil.com/stjc/rest/stj/1.0/api/table/customField/{customFieldId}?page=0&jql={jql_query}

Variables: :customFieldId

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/comma/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

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

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

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

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.

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.

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

 

© 2023, STAGIL