Linking a document to a Jira issue
On this page
You can link a document or folder to a Jira issue by creating a remote link for that issue. This can be done via Jira REST API.
Request URL
The request URL takes the following form:
POST <ROOT>/rest/api/latest/issue/{issueIdOrKey}/remotelink
Replace "<ROOT>" with the base URL of your Jira server.
Parameters
You have to specify the following parameters:
Parameter | Description |
---|---|
{issueIdOrKey} | The id or the key of the Jira issue where the document will be linked. |
Also, the body of the request must contain a JSON with the required attributes.
An example of the request body is as follows:
{
"globalId": "stonikbyte:document-519",
"application": {
"type": "com.stonikbyte.jira.plugins.project-docs-plugin",
"name": "Documents"
},
"relationship": "linked documents",
"object": {
"url": "<ROOT>/plugins/servlet/StonikByte/Document?id=519",
"title": "519"
}
}
In this example, the document with the key (id) 519 is linked to an issue. To link a document or folder, just replace '519' with the key (id) of the document or folder than you want to link.
A successful response
An HTTP 200 status response indicates a successful request.
Error Response
If the REST call fails, the service returns one of the following HTTP statuses:
HTTP Status Code | Description |
---|---|
400 | Returned if the input is invalid (e.g. missing required fields, invalid values, and so forth). |
401 | Returned for unauthenticated requests. |
403 | Returned if the calling user does not have permission to create/update the remote issue link, or if issue linking is disabled. |
Â