-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Low
-
None
-
Affects Version/s: 7.9.0, 10.3.0, 11.3.0
-
Component/s: Development Panel
-
7.09
-
7
-
Severity 3 - Minor
-
1
Summary
The "Development" custom field REST API doesn't return result in the correct format.
Steps to Reproduce
- Integrate Jira with Bitbucket Cloud, GitHub, or GitLab.
- Create a branch from a Jira issue.
- Get this issue using REST API (or webhook) using /rest/api/2/issue/<issue-key>.
Expected Results
The development field returns in a usable JSON format.
Actual Results
The value of the development field is shown as a single string. For example:
"customfield_10000":"{summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@370857b8[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@3a7bd3f3[overall=com.atlassian.jira.plugin.devstatus.summary.beans.PullRequestOverallBean@430f8ad2[stateCount=0,state=OPEN,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@c309d5d[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@79f0aef4[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@1df01e72[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@22965e04[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@2a44f57e[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@56bf79cc[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@4b21fee7[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@5bd7fff9[count=1,lastUpdated=2018-04-13T18:58:53.000+0800,lastUpdatedTimestamp=2018-04-13T18:58:53.000+08:00],byInstanceType={bitbucket=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@45999344[count=1,name=Bitbucket Cloud]}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@7be97ceb[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@3ffb73b7[count=1,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={bitbucket=com.atlassian.jira.plugin.devstatus.summary.beans.ObjectByInstanceTypeBean@61392090[count=1,name=Bitbucket Cloud]}]},errors=[],configErrors=[]], devSummaryJson={\"cachedValue\":{\"errors\":[],\"configErrors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":\"OPEN\",\"open\":true},\"byInstanceType\":{}},\"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\":1,\"lastUpdated\":\"2018-04-13T18:58:53.000+0800\"},\"byInstanceType\":{\"bitbucket\":{\"count\":1,\"name\":\"Bitbucket Cloud\"}}},\"branch\":{\"overall\":{\"count\":1,\"lastUpdated\":null},\"byInstanceType\":{\"bitbucket\":{\"count\":1,\"name\":\"Bitbucket Cloud\"}}}}},\"isStale\":false}}",
Workaround
Use the internal REST endpoints.
Summary
For the high-level summary (same information shown in the Development issue panel):
curl -L -X GET 'https://jira.example.com/rest/dev-status/1.0/issue/summary?issueId=10000' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN'
Replace the base URL and YOUR_TOKEN with an OAuth 2.0 token (recommended) or Personal Access Token (PAT). The issue ID is provided in the GET /rest/api/2/issue/{issueIdOrKey} REST API output.
Details
To obtain the data displayed in the respective dialogs, you can use:
curl -L -X GET 'https://jira.example.com.com/rest/dev-status/1.0/issue/detail?issueId=10000&applicationType=bitbucket&dataType=pullrequest' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer YOUR_TOKEN'
Replace bitbucket with the appropriate development tool if you're not using Bitbucket Cloud. This will be identified in the /summary output under the byInstanceType object. For example: github, githube, gitlabselfmanaged, etc.
The supported values for dataType are:
- pullrequest
- branch
- repository (commits)
Disclaimer
Since these endpoints are not part of the published REST API, they're considered internal and might be changed or removed without a deprecation notice in future Jira Data Center releases.
- links to