REST API Requests

REST API Requests

Variables

Advanced Links

:customFieldID is an ID of the relation custom field. It can be identified by going to Settings → Marketplace apps → STAGIL Assets → Advanced Links, then clicking on the inward or outward Advanced Link field to open its configuration page. There, the Field Configuration ID will appear.

:issueIdOrKey requires ID or key of the issue, where a relations table is present.

:LinkedIssueIdOrKey is an ID or key of the linked issue.

Issue Filter Panels

:customFieldID is the ID of the Issue Filter Panel. You can identify it by navigating to Settings → Marketplace apps → STAGIL Assets → Issue Filter Panels. Then click Actions next to the panel in question and hover over the Manage button. In the lower-left corner of your browser, the URL will display the panel ID.

:contextID is the ID of the field’s context. You can locate it by going to the field’s context and hovering over Edit STAGIL Assets Issue Filter Panel. The URL displayed in the lower-left corner of the browser contains the context ID as the last number.

Use apps.stagil.com as a base URL for your calls.

Advanced Links

Get Links

Method: GET

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/issueLink/issue/:issueIdOrKey

Requires ‘Browse project’ permission.

Get Links: multiple links at once

Version 1.0

Method: POST

Description: returns names of the Advanced Links fields and linked issue keys.

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/issueLink/issue/:issueIdOrKey

// Use an array of issue keys { "issues" : [ "LO-18", "LO-218", "LO-21", "LO-214", "LO-212", "LO-211", "LO-209", "LO-207", "LO-206", "LO-205", "LO-204", "LO-202", "LO-200", "LO-199", "LO-197", "LO-41" ] }
{ "LO-41": { "Employee - Software License": { "belongs to": { "id": 14525, "linkedIssues": [ "DEMO-26", "DEMO-27" ] } }, "Employee - Laptop": { "possesses": { "id": 14518, "linkedIssues": [ "DEMO-19" ] } } } }

Version 2.0

Method: POST

Description: returns the IDs and names of Advanced Links fields, along with the IDs and keys of the linked issues. This is more structured and detailed format, suitable for programmatic parsing.

API call: https://apps.stagil.com/sajc/rest/saj/2.0/api/assets/issueLink/issue/:issueIdOrKey

// Use an array of issue keys { "issues" : [ "LO-18", "LO-218", "LO-21", "LO-214", "LO-212", "LO-211", "LO-209", "LO-207", "LO-206", "LO-205", "LO-204", "LO-202", "LO-200", "LO-199", "LO-197", "LO-41" ] }
{ "LO-41": [ { "id": "12645", "name": "Employee - Software License", "outward": { "name": "belongs to", "id": "14525", "linkedIssues": [ { "id": "10170", "key": "DEMO-26" }, { "id": "10171", "key": "DEMO-27" } ] } }, { "id": "12642", "name": "Employee - Laptop", "outward": { "name": "possesses", "id": "14518", "linkedIssues": [ { "id": "10161", "key": "DEMO-19" } ] } } ] }

Body can contain max 100 issues per call.

Get Advanced Links configuration info

Method: GET

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/relations?expandFieldContexts=true

Description: returns name of the Advanced Link, labels for outward/inward link direction, context configuration (project and issue types selected) along with their IDs. 

{ "id": 12644, "idAsString": "12644", "name": "Laptop - Software License", "color": "#8B008B", "outward": "has installed", "inward": "installed on", "showInGraph": true, "outwardContexts": [ { "id": 30615, "name": "All projects:Laptop", "field": { "id": 14523, "jql": "order by key desc", "maxSelection": 0 }, "projectIds": [ 10011 ], "issueTypeIds": [ "10006" ] } ], "inwardContexts": [ { "id": 30616, "name": "All projects:Software License", "field": { "id": 14524, "jql": "order by key desc", "maxSelection": 0 }, "projectIds": [ 10011 ], "issueTypeIds": [ "10026" ] } ] }

Create Link

Method: Post

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/issueLink/issue/:issueIdOrKey/customField/:customFieldId

Requires ‘Edit issue’ permission.

Delete Link

Method: Delete

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/issueLink/customField/:customFieldId/issue/:issueIdOrKey/linkedIssue/:linkedIssueIdOrKey"

Issue Filters

Panel context: GET Projects in field context

Method: Get

Description: returns project IDs from the Issue Filter Panel.

https//apps.stagil.com/sajc/rest/saj/1.0/api/assets/context/customField/:customFieldId/project

Parameter: customFieldId

[ { "contextId": "60", "contextName": "All Projects:All Issue Types", "projectIds": [ "-1" ] } ]

Panel context: add new projects to the context

Method: Post

Description: updates the project list in the field context

https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/context/:contextId/customField/:customFieldId/project

Parameter: customFieldId, contextId

// list of project IDs [ "10000", "10001", "10002", "10003", "10292" ]

Database synchronisation

Trigger SQL database synchronisation

Method: Get

Description: starts database synchronisation.

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/synchronizer/{id}/run

{id} - database synchroniser ID

SQL database synchronisation status

Method: Get

Description: shows database synchronisation status.

API call: https://apps.stagil.com/sajc/rest/saj/1.0/api/assets/synchronizer/{id}/status

{id} - database synchroniser ID

Stop SQL database synchronisation

Method: Get

Description: stops database synchronisation status.

API call: https://apps.stagil.com/sajc//rest/saj/1.0/api/assets/synchronizer/{id}/stop

{id} - database synchroniser ID

Postman Collection

Use apps.stagil.com as a base URL for your calls.