Uploaded image for project: 'Jira Software Cloud'
  1. Jira Software Cloud
  2. JSWCLOUD-16901

Provide a public REST API endpoint to get development info associated with an issue

    XMLWordPrintable

    Details

    • UIS:
      2
    • Feedback Policy:

      Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      Summary

      Provide a public API to get the Development information (mainly the repository, branches, commits, pull requests, builds and deployments) related to an issue.

      Background

      There exists a private API that returns development information. However, the endpoints discussed below are intended for internal use only. Therefore, they are not part of the official Jira Software REST APIsthey are not supported and they can change without any notice. Also, they only work when using basic authentication with an Atlassian account email address and API token to authorize the REST API calls.

      Once this has been said:

      1. You can use the internal endpoint /rest/dev-status/latest/issue/summary?issueId=<ISSUE_ID> (replace <ISSUE_ID> with the actual ID of the Jira issue you want to GET the information from) to get the information displayed in the development panel of an issue. 
      2. You can use the information returned by above call to correctly populate the parameters for the endpoint: /rest/dev-status/latest/issue/detail?issueId=10195&applicationType=<APPLICATION-TYPE>&dataType=<DATA_TYPE>

      EXAMPLES:

      1) On my side calling https://NAME.atlassian.net/rest/dev-status/latest/issue/summary?issueId=10195 returns:

      {
        "errors": [],
        "configErrors": [],
        "summary": {
          "pullrequest": {
            "overall": {
              "count": 0,
              [..REMOVED..] 
              "dataType": "pullrequest",
              "open": true
            },
            "byInstanceType": {}
          },
          "build": {
            "overall": {
              [..REMOVED..]
              "dataType": "build"
            },
            "byInstanceType": {}
          },
          "review": {
            "overall": {
              [..REMOVED..]
              "dataType": "review",
              "completed": false
            },
            "byInstanceType": {}
          },
          "deployment-environment": {
            "overall": {
              [..REMOVED..]
              "dataType": "deployment-environment"
            },
            "byInstanceType": {}
          },
          "repository": {
            "overall": {
              "count": 2,
              "lastUpdated": "2019-10-31T17:53:18.000+0100",
              "dataType": "repository"
            },
            "byInstanceType": {
              "GitHub": {
                "count": 2,
                "name": "GitHub"
              }
            }
          },
          "branch": {
            "overall": {
              "count": 1,
              "lastUpdated": null,
              "dataType": "branch"
            },
            "byInstanceType": {
              "GitHub": {
                "count": 1,
                "name": "GitHub"
              }
            }
          }
        }
      }
      

       

      2)  Then, calling https://NAME.atlassian.net/rest/dev-status/latest/issue/detail?issueId=10195&applicationType=GitHub&dataType=branch returns:

       

      {
        "errors": [],
        "detail": [
          {
            "branches": [
              {
                "name": "[REMOVED]-branch-SFF-27",
                "url": "https://github.com/[REMOVED]/1st_repository/tree/[REMOVED]-branch-SFF-27",
                "createPullRequestUrl": "https://github.com/[REMOVED]/1st_repository/pull/new/[REMOVED]-branch-SFF-27",
                "repository": {
                  "name": "[REMOVED]/1st_repository",
                  "url": "https://github.com/[REMOVED]/1st_repository",
                  "branches": []
                },
                "lastCommit": {
                  "id": "85663xxxxxxxxxxxxx",
                  "displayId": "85663f",
                  "authorTimestamp": "2019-10-31T16:53:18.000+0000",
                  "url": "https://github.com/[REMOVED]/1st_repository/commit/85663fxxxxxxxxxxxxxxx",
                  "author": {
                    "name": "[REMOVED]"
                  },
                  "fileCount": 0,
                  "merge": false,
                  "message": "Create SFF-27 again",
                  "files": []
                }
              }
            ],
            "pullRequests": [],
            "repositories": [],
            "_instance": {
              "name": "GitHub",
              "baseUrl": "https://github.com",
              "type": "GitHub",
              "id": "com.github.integration.production",
              "typeName": "GitHub",
              "singleInstance": true
            }
          }
        ]
      }
      

       

       OTHER EXAMPLES:

      • Returns branches and pull requests
        https://<instance-name>.atlassian.net/rest/dev-status/latest/issue/detail?issueId=134963&applicationType=bitbucket&dataType=branch
        
      • Returns repository and commits
        https://<instance-name>.atlassian.net/rest/dev-status/latest/issue/detail?issueId=134963&applicationType=bitbucket&dataType=repository
        

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              acalantog Anne Calantog
              Votes:
              85 Vote for this issue
              Watchers:
              54 Start watching this issue

                Dates

                Created:
                Updated: