REST API Specification

You can use API from VERSION 1.14.0+

Authentication

Support only Basic auth but any authentication that will works against JIRA will work against the REST API.

Content Type

Use "Content-Type: application/json" in http header when sending data to the REST-API's.

Get Alfresco document Id linked to a Jira issue

URL

GET /rest/alfresco/latest/link/issue/{issueKey}/object

Request

PATH PARAMETERS
  • issueKey

    • Issue key

QUERY PARAMETERS
  • start

    • Start position of the result to be obtained. Default 0

  • limit

    • Maximum number of items to be acquired. Default 10

BODY PARAMETERS
  • None

Response

STATUS 200

1 2 3 4 5 6 7 8 9 10 { "start": 0, "limit": 10, "size": 3, "results": [ "72948f84-4bf1-4ec5-8378-1bed0951600a", "1a0b110f-1e09-4ca2-b367-fe25e4964a4e", "05dedd34-9d9d-48d9-9af6-c81b555541c9" ] }


STATUS 400 If the request is not correct
STATUS 401 If the user is not authenticated
STATUS 404 If the issue does not exit or it the user does not have permission to browse issue.

Example

1 2 3 4 curl --request GET \ --url 'http://localhost:2990/jira/rest/alfresco/latest/link/issue/AAA-1/object?start=0&limit=10' \ --user admin:admin \ --header 'Accept: application/json'

Get Alfresco document Id linked to a Jira project

URL

GET /rest/alfresco/latest/link/project/{projectKey}/object

Request

PATH PARAMETERS
  • projectKey

    • Project key

QUERY PARAMETERS
  • start

    • Start position of the result to be obtained. Default 0

  • limit

    • Maximum number of items to be acquired. Default 10

BODY PARAMETERS
  • None

Response

STATUS 200

1 2 3 4 5 6 7 8 9 10 { "start": 0, "limit": 10, "size": 3, "results": [ "72948f84-4bf1-4ec5-8378-1bed0951600a", "1a0b110f-1e09-4ca2-b367-fe25e4964a4e", "05dedd34-9d9d-48d9-9af6-c81b555541c9" ] }


STATUS 400 If the request is not correct
STATUS 401 If the user is not authenticated
STATUS 404 If the issue does not exit or it the user does not have permission to browse issue.

Example

1 2 3 4 curl --request GET \ --url 'http://localhost:2990/jira/rest/alfresco/latest/link/project/AAA/object?start=0&limit=10' \ --user admin:admin \ --header 'Accept: application/json'

Link Alfresco document to Jira Issues

URL

POST /rest/alfresco/latest/link/object/{objectId}

Request

PATH PARAMETERS
  • objectId

    • Alfresco Document Id

QUERY PARAMETERS
  • None

BODY PARAMETERS
1 2 3 4 5 6 7 8 9 10 { "issueKeys": [ "AAA-1" ], "objects": [ { "objectId": "7bb7bfa8-997e-4c55-8bd9-2e5029653bc8" } ] }

Response

STATUS 200

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "links": { "7bb7bfa8-997e-4c55-8bd9-2e5029653bc8": [ { "projectId": 10000, "issueId": 10000, "objectId": "7bb7bfa8-997e-4c55-8bd9-2e5029653bc8", "authorKey": "JIRAUSER10000", "username": "admin", "created": 1597597897073, "enableUnlink": true } ] } }


STATUS 400 If the request is not correct
STATUS 401 If the user is not authenticated
STATUS 403 If the user does not have a link permission
STATUS 404 If the issue does not exit or it the user does not have permission to browse issue

Example

1 2 3 4 5 6 curl --request POST \ --url 'http://localhost:2990/jira/rest/alfresco/latest/link/object/7bb7bfa8-997e-4c55-8bd9-2e5029653bc8' \ --user admin:admin \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{"issueKeys":["AAA-1"],"objects":[{"objectId":"7bb7bfa8-997e-4c55-8bd9-2e5029653bc8"}]}'

Note

Request parameter of "objectId" is Document Id of Alfresco.

Unlink Alfresco document to Jira Issues

URL

DELETE /rest/alfresco/latest/link/object/{objectId}

Request

PATH PARAMETERS
  • objectId

    • Alfresco Document Id

QUERY PARAMETERS
  • なし

BODY PARAMETERS
1 2 3 4 5 6 7 8 9 10 { "issueKeys": [ "AAA-1" ], "objects": [ { "objectId": "7bb7bfa8-997e-4c55-8bd9-2e5029653bc8" } ] }

Response

STATUS 200

1 2 3 { "links": {} }


STATUS 400 If the request is not correct
STATUS 401 If the user is not authenticated
STATUS 403 If the user does not have a link permission
STATUS 404 If the issue does not exit or it the user does not have permission to browse issue

Example

1 2 3 4 5 6 curl --request DELETE \ --url 'http://localhost:2990/jira/rest/alfresco/latest/link/object/7bb7bfa8-997e-4c55-8bd9-2e5029653bc8' \ --user admin:admin \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{"issueKeys":["AAA-1"],"objects":[{"objectId":"7bb7bfa8-997e-4c55-8bd9-2e5029653bc8"}]}'

Note

"objectId" is Document Id of Alfresco.