Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-15768

REST API access to information in Development Panel

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • None
    • REST API
    • None
    • 49
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      As a developer, I want to write a program that has access to the connections from a JIRA issue to the related branches, pull requests, commits, and builds so that I can automate more aspects of the deployment pipeline.

      Workaround

      According to THIS COMMENT the internal endpoint provided as a workaround for JSWCLOUD-16901 should work too:

      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/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/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

              Unassigned Unassigned
              ibuchanan devpartisan
              Votes:
              170 Vote for this issue
              Watchers:
              86 Start watching this issue

              Dates

                Created:
                Updated: