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

/rest/api/3/issue/ REST API endpoint provides only a part of a Development info associated with an issue

XMLWordPrintable

    • 693
    • 74
    • 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.

      Summary

      Response for a /rest/api/3/issue/<issue-key> API call in Jira Cloud only returns pullreqests in a Development field (customfield_10000):

      "customfield_10000": "{pullrequest={dataType=pullrequest, state=OPEN, stateCount=1}, json={\"cachedValue\":{\"errors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":1,\"lastUpdated\":\"2024-05-22T12:01:58.224+0200\",\"stateCount\":1,\"state\":\"OPEN\",\"dataType\":\"pullrequest\",\"open\":true},\"byInstanceType\":{\"bitbucket\":{\"count\":1,\"name\":\"Bitbucket Cloud\"}}}}},\"isStale\":false}}"
      

      DC, for comparison, returns all details such as branches, commits, and pullrequests:

      "customfield_10000": {summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@5c38938f[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@22be8cfe[overall=PullRequestOverallBean{stateCount=2, state='MERGED', details=PullRequestOverallDetails{openCount=0, mergedCount=2, declinedCount=0}},byInstanceType={stash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@3a8230d[count=2,name=Bitbucket]}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@55a786fa[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@6b6b7d75[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@533fbba4[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@11cd4a85[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@78b48e10[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@4804c4a6[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6648a499[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@1daa53b7[count=2,lastUpdated=2023-10-23T12:52:05.000+0100,lastUpdatedTimestamp=2023-10-23T12:52:05.000+01:00],byInstanceType={stash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@41329a1c[count=2,name=Bitbucket]}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@2ffd4768[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@cb25262[count=1,lastUpdated=2023-10-17T23:59:57.160+0100,lastUpdatedTimestamp=2023-10-17T23:59:57.160+01:00],byInstanceType={stash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@43ca9fa8[count=1,name=Bitbucket]}]},errors=[],configErrors=[]], devSummaryJson={\<%7bsummaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@5c38938f[summary=%7bpullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@22be8cfe[overall=PullRequestOverallBean%7bstateCount=2,%20state='MERGED',%20details=PullRequestOverallDetails%7bopenCount=0,%20mergedCount=2,%20declinedCount=0%7d%7d,byInstanceType=%7bstash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@3a8230d[count=2,name=Bitbucket]%7d],%20build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@55a786fa[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@6b6b7d75[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=%3cnull%3e,lastUpdatedTimestamp=%3cnull%3e],byInstanceType=%7b%7d],%20review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@533fbba4[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@11cd4a85[stateCount=0,state=%3cnull%3e,dueDate=%3cnull%3e,overDue=false,count=0,lastUpdated=%3cnull%3e,lastUpdatedTimestamp=%3cnull%3e],byInstanceType=%7b%7d],%20deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@78b48e10[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@4804c4a6[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=%3cnull%3e,lastUpdatedTimestamp=%3cnull%3e],byInstanceType=%7b%7d],%20repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6648a499[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@1daa53b7[count=2,lastUpdated=2023-10-23T12:52:05.000+0100,lastUpdatedTimestamp=2023-10-23T12:52:05.000+01:00],byInstanceType=%7bstash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@41329a1c[count=2,name=Bitbucket]%7d],%20branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@2ffd4768[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@cb25262[count=1,lastUpdated=2023-10-17T23:59:57.160+0100,lastUpdatedTimestamp=2023-10-17T23:59:57.160+01:00],byInstanceType=%7bstash=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@43ca9fa8[count=1,name=Bitbucket]%7d]%7d,errors=[],configErrors=[]],%20devSummaryJson=%7b\>cachedValue\":{\"errors\":[],\"configErrors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":2,\"lastUpdated\":\"2024-01-30T14:53:23.553+0000\",\"stateCount\":2,\"state\":\"MERGED\",\"details\":{\"openCount\":0,\"mergedCount\":2,\"declinedCount\":0,\"total\":2},\"open\":false},\"byInstanceType\":{\"stash\":{\"count\":2,\"name\":\"Bitbucket\"}}},\"build\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"failedBuildCount\":0,\"successfulBuildCount\":0,\"unknownBuildCount\":0},\"byInstanceType\":{}},\"review\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":null,\"dueDate\":null,\"overDue\":false,\"completed\":false},\"byInstanceType\":{}},\"deployment-environment\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"topEnvironments\":[],\"showProjects\":false,\"successfulCount\":0},\"byInstanceType\":{}},\"repository\":{\"overall\":{\"count\":2,\"lastUpdated\":\"2023-10-23T12:52:05.000+0100\"},\"byInstanceType\":{\"stash\":{\"count\":2,\"name\":\"Bitbucket\"}}},\"branch\":{\"overall\":{\"count\":1,\"lastUpdated\":\"2023-10-17T23:59:57.160+0100\"},\"byInstanceType\":{\"stash\":{\"count\":1,\"name\":\"Bitbucket\"}}}}},\"isStale\":false}}" 

      Workaround

      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
        

            Unassigned Unassigned
            acalantog Anne Calantog
            Votes:
            386 Vote for this issue
            Watchers:
            216 Start watching this issue

              Created:
              Updated: