...
Install and use Atlassian's REST API Browser and explore URLs inside of your Confluence / Jira application:
REST Resources in Confluence
Verb and URL | Comments and query string arguments |
---|---|
GET /rest/reqs/1/requirement2/{spaceKey} | Search for requirements.
|
POST /rest/reqs/1/requirement2/{spaceKey} | Do not use. |
PUT /rest/reqs/1/requirement2/{spaceKey} | Do not use. |
GET /rest/reqs/1/requirement2/{spaceKey}/{key} | Get a requirement.
|
POST /rest/reqs/1/requirement2/{spaceKey}/{key} | Do not use. |
PUT /rest/reqs/1/requirement2/{spaceKey}/{key} | Do not use. |
DELETE /rest/reqs/1/requirement2/{spaceKey}/{key} | Do not use. |
GET /rest/reqs/1/requirement3 | Do not use. |
Baselines | |
GET /rest/reqs/1/baseline/{spaceKey} | Get the list of baselines in this space.
|
POST /rest/reqs/1/baseline/{spaceKey}/1/create | Freeze a baseline. |
All other information is available in the REST API Browser.
REST API in Jira
There is no specific REST API in Jira for Requirement Yogi, but links can be added in the "Remote Issue Links" (RIL) using the REST API of Jira:
- The Jira documentation is available at this address: https://developer.atlassian.com/server/jira/platform/jira-rest-api-for-remote-issue-links/
- To create a Requirement Yogi RIL, one must use the type "com.playsql.requirementyogi.type" and a specific GlobalID.
One easy way to see how Requirement Yogi creates a link is to use the "Network" panel in the developer tools of Confluence:
Example of payload:
Code Block | ||
---|---|---|
| ||
{
"globalId":"applink=d17e62d1-4e84-3467-891d-2e097fc86c52&spaceKey=EX&key=REQ-001&issue=SAM-8&relationship=implements",
"application":{
"name":"Confluence in space EX",
"type":"com.playsql.requirementyogi.type"
},
"relationship":"implements",
"object":{
"url":"http://confluence.local:1990/confluence/requirements/EX/REQ-001",
"title":"REQ-001",
"summary":"- Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.",
"icon":{
"url16x16":"http://confluence.local:1990/confluence/download/resources/com.playsql.requirementyogi/img/requirementyogi-icon-2-x16.png",
"title":"Requirement Yogi"
}
}
} |
- Fields are self-explanatory,
- The type must be "com.playsql.requirementyogi.type",
- The globalId must retain the same format, in the same order:
- applink: The ID of the application link in Jira,
- spaceKey and key: The references to the requirement,
- issue: The Jira issue key
- relationship: The relationship
- This means that any change to the relationship, issue number or space must be reflected in the form of a deletion of the old link and recreation with the correct GlobalId.
- Upon creation, Requirement Yogi indexes the new links and notifies Confluence of the creation of a link.
- The Summary will be kept up-to-date by manual and auto synchronization.
...
The body must be in JSON:
The ceo is the baseline page. It is not the page which contains the original definition of the requirements. It can be any arbitrary page, its title will be synchronized with the name of the baseline, and if there is a Baseline macro on it, this macro will show the count of requirements. The queryString is the list of all requirements which must be copied and archived in this baseline. | ||||||||
POST /rest/reqs/1/baseline/{spaceKey}/1/create-instant | Create and freeze instantly a baseline. There will be no parent page for this baseline. The body must be JSON:
If fromCeoWithChildren is true, the requirements of all the child pages will be baselined too. | |||||||
DELETE /rest/reqs/1/baseline/{spaceKey}/{baseline} | Delete a baseline. No JSON body. | |||||||
PUT /rest/reqs/1/baseline/{spaceKey}/{baseline}/label | Change the label of a baseline. Use a text/plain body. | |||||||
GET /rest/reqs/1/baseline/{spaceKey}/{baseline}/pages | Returns the list of pages which have requirements of this baseline. | |||||||
POST /rest/reqs/1/sync | Deprecated. Do not use. | |||||||
POST /rest/reqs/1/helpers/reindex/{contentId} | Reindexes a page. It will only mark the requirements are ACTIVE/DELETED and flag them as "Needs excerpt", which means those requirements will appear with a red dot. The next time a user views the page, excerpts will be gathered and saved as the text and properties of requirements, and the red dot will disappear. | |||||||
GET /rest/reqs/1/integration | Returns the list of application links and their RY configuration. Permissions: Confluence administrators only.
| |||||||
POST /rest/reqs/1/integration | Create an integration. Don't do it. Permissions: Confluence administrators only. | |||||||
GET /rest/reqs/1/integration/{serviceId} | Returns the details of the integration:
Permissions: Confluence administrators only. | |||||||
PUT /rest/reqs/1/integration/{serviceId} | Updates the descriptor. Permissions: Confluence administrators only. | |||||||
GET /rest/reqs/1/integration/{serviceId}/queue/outbound?limit=50 | Get the list of messages which will be sent to Jira in the next synchronization (every 3 mintues):
| |||||||
PUT /rest/reqs/1/integration/{serviceId}/queue/outbound/{messageId} | PUT sends this item to Jira. No body necessary. DELETE removes this message from the list. |
All other information is available in the REST API Browser.
REST API in Jira
Verb and URL | Comments and query string arguments | |||||
---|---|---|---|---|---|---|
GET /rest/reqs/1/api | Displays generic information about this REST resource. Also displays the current user's name.
Anonymous-allowed. | |||||
POST /rest/reqs/1/api | Posts messages from Confluence to Jira. Messages are encoded in JSON:
| |||||
PUT /rest/reqs/1/api/{applinkId}/mode | Changes the API mode. The body must be a string between quotes: AUTO, MANUAL, DISABLED, sent with a JSON content type. | |||||
PUT /rest/reqs/1/api/{applinkId}/version | Changes the API version. The body is an integer, sent with a JSON content type. The API changes the version and tells the user which version was accepted (in case Jira doesn't support that version). | |||||
GET /rest/reqs/1/issuelinks | Not implemented, returns a fixed string. | |||||
GET /rest/reqs/1/issuelinks/{issueKey} | Returns the links on an issue. A ?relationship= parameter can be specified. | |||||
POST /rest/reqs/1/issuelinks/{issueKey} | Creates issue links. Body is JSON:
The HTML is updated for this requirement in Jira, which means if another Jira issue has a link to the same requirement, its text will be updated. | |||||
PUT /rest/reqs/1/issuelinks/{issueKey} | Same as POST, but removes all existing links on this issue before. Can be scoped using ?relationship=... | |||||
DELETE /rest/reqs/1/issuelinks/{issueKey} | List of links to delete from this issue:
| |||||
PUT /rest/reqs/1/sync?issues=PROJ-2,PROJ-1 | Ask Jira to resynchronize those issues with Confluence:
All links of all requirements linked with the specified issues are synced. It means:
|