• Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • REST API
    • None
    • 69
    • 27
    • 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.

      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

          Form Name

            [JSWSERVER-15768] REST API access to information in Development Panel

            Yes would be extremely helpful for me as well

            Aravind Padmanabhan added a comment - Yes would be extremely helpful for me as well

            Daniel Pasch-Sannapiu added a comment - - edited

            That's great when you want to link Bitbucket (although Bitbucket Cloud is laughably outdated, takes hours for Pull Requests to show up in Jira). But I want to link gitea, a different git host. 

            Daniel Pasch-Sannapiu added a comment - - edited That's great when you want to link Bitbucket (although Bitbucket Cloud is laughably outdated, takes hours for Pull Requests to show up in Jira). But I want to link gitea, a different git host. 

            BIF01 added a comment -

            I want to setup a custom integration that links Jira issues to Pull Requests.

            When you mention a Jira issue key in a Bitbucket commit, branch, or pull request, the two are automatically linked.

            BIF01 added a comment - I want to setup a custom integration that links Jira issues to Pull Requests. When you mention a Jira issue key in a Bitbucket commit, branch, or pull request, the two are automatically linked.

            Fetching is nice and all but has anyone discovered the API for Updating that data? 

            I want to setup a custom integration that links Jira issues to Pull Requests.

            Daniel Pasch-Sannapiu added a comment - Fetching is nice and all but has anyone discovered the API for Updating that data?  I want to setup a custom integration that links Jira issues to Pull Requests.

            BIF01 added a comment -

            Some of the data, e.g. commit sha, can be fetched using DVCS Plugin REST API. 

            bitbucket/1.0/jira-dev/detail?issue={issueKey} returns nothing:

            { "repositories": [] }

            dev-status/1.0/issue/detail?issueId={issueId}&applicationType=stash&dataType=repository returns correct info:
            {
            "errors": [],
            "detail": [
              {
                "repositories": [
               

            {         "name": ...,         "commits": [...]     }

                }
            }

            BIF01 added a comment - Some of the data, e.g. commit sha, can be fetched using DVCS Plugin REST API.  bitbucket/1.0/jira-dev/detail?issue={issueKey } returns nothing: { "repositories": [] } dev-status/1.0/issue/detail?issueId={issueId}&applicationType=stash&dataType=repository returns correct info: { "errors": [], "detail": [   {     "repositories": [     {         "name": ...,         "commits": [...]     }     } }

            Hello,

            Some of the data, e.g. commit sha, can be fetched using DVCS Plugin REST API. The only param of the methods marked on the attached picture is `issueKey`.
            Please be aware that some of those REST methods are marked as an experimental api, some are private (accessible only by Jira Admin). Feel free to reach out to us in case of any issues with the usage.

            Please let us know if this is something you were looking for.

            Best Regards,
            Maciej Sujkowski
            DVCS Dev Team

            Maciej Sujkowski (Inactive) added a comment - Hello, Some of the data, e.g. commit sha, can be fetched using DVCS Plugin REST API. The only param of the methods marked on the attached picture is `issueKey`. Please be aware that some of those REST methods are marked as an experimental api, some are private (accessible only by Jira Admin). Feel free to reach out to us in case of any issues with the usage. Please let us know if this is something you were looking for. Best Regards, Maciej Sujkowski DVCS Dev Team

            “Atlassian: Gathering Interest Since 2017”

            This is a huge issue. Why is it not being addressed? 

            Lady Glencora added a comment - “Atlassian: Gathering Interest Since 2017” This is a huge issue. Why is it not being addressed? 

            Aaron Matthys added a comment - - edited

            This feature would be EXTREMELY useful for developers using Gitlab. Apparently the commit IDs used to show in the API when we had Bitbucket. 

            Aaron Matthys added a comment - - edited This feature would be EXTREMELY useful for developers using Gitlab. Apparently the commit IDs used to show in the API when we had Bitbucket. 

            Hi,

            Any updates on this.  The endpoint does not return useful information that is shown on the popup.  Would be nice to have that info somehow.

            thank you,

            Pascal

            Pascal Champagne added a comment - Hi, Any updates on this.  The endpoint does not return useful information that is shown on the popup.  Would be nice to have that info somehow. thank you, Pascal

            My current Jira version is 8.3.2 and these work for me.

            https://my-instance-of-jira/rest/dev-status/latest/issue/detail?issueId=*****&applicationType=stash&dataType=pullrequest
            https://my-instance-of-jira/rest/dev-status/latest/issue/detail?issueId=*****&applicationType=stash&dataType=repository
            

            Aaron Yang added a comment - My current Jira version is 8.3.2 and these work for me. https://my-instance-of-jira/rest/dev-status/latest/issue/detail?issueId=*****&applicationType=stash&dataType=pullrequest https://my-instance-of-jira/rest/dev-status/latest/issue/detail?issueId=*****&applicationType=stash&dataType=repository

              Unassigned Unassigned
              ibuchanan devpartisan
              Votes:
              183 Vote for this issue
              Watchers:
              96 Start watching this issue

                Created:
                Updated: