Access Git Repo Commit Data via Jira REST API in Development Panel (Data Center)
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In this article, we will describe a scenario for retrieving this commit data on the ticket on a different application using the Jira REST API.
Environment
Jira Data Center Versions 9.x, 10.x, 11.x
Solution
There are two options to gather the data:
Internal REST API
Jira itself uses the internal dev-status REST API to fetch the Development panel information of an issue.
This dev-status API can be used as follows:
# Syntax <base-url>/rest/dev-status/1.0/issue/detail?issueId=<issueId>&applicationType=githube&dataType=repository # Example curl -su "jirauser:jirapassword" '<base-url>/rest/dev-status/1.0/issue/detail?issueId=10102&applicationType=githube&dataType=repository'|jq { "errors": [], "detail": [ { "repositories": [ { "name": "testRepo", "url": "<githube-url>/testorg/testrepo", "commits": [ { "id": "bf180504df890b23e828512f5ea1dffb4a5d057c", "displayId": "bf18050", "authorTimestamp": "2025-03-25T12:42:57.000+0000", "url": "<githube-url>/testorg/testrepo/commit/bf180504df890b23e828512f5ea1dffb4a5d057c", "author": { "name": "supportadmin", "avatar": "<githube-url>/avatars/u/5?" }, "fileCount": 1, "merge": false, "message": "KAN1-3 2", "files": [ { "path": "README.md", "url": "<githube-url>/testOrg/testRepo/commit/bf180504df890b23e828512f5ea1dffb4a5d057c#diff-0", "changeType": "MODIFIED", "linesAdded": 2, "linesRemoved": 0 } ] }, { "id": "80525ba81e50e8841403c1e98931ab16595e84c4", "displayId": "80525ba", "authorTimestamp": "2025-03-25T12:23:40.000+0000", "url": "<githube-url>/testorg/testrepo/commit/80525ba81e50e8841403c1e98931ab16595e84c4", "author": { "name": "supportadmin", "avatar": "<githube-url>/avatars/u/5?" }, "fileCount": 1, "merge": false, "message": "KAN1-3", "files": [ { "path": "README.md", "url": "<githube-url>/testOrg/testRepo/commit/80525ba81e50e8841403c1e98931ab16595e84c4#diff-0", "changeType": "MODIFIED", "linesAdded": 2, "linesRemoved": 1 } ] } ] } ], "_instance": { "name": "GitHub Enterprise", "typeName": "GitHub Enterprise", "id": "githube", "type": "githube", "singleInstance": true, "baseUrl": "https://github.com" } } ] }
Bitbucket REST API
You can also use the Bitbucket REST API as described below:
# Syntax
<base-url>/rest/bitbucket/1.0/jira-dev/detail?issue=<issueKey>
#Example
curl -su "admin:sphere" "<base-url>/rest/bitbucket/1.0/jira-dev/detail?issue=KAN1-3"|jq
{
"repositories": [
{
"name": "testRepo",
"slug": "testRepo",
"url": "<githube-url>/testorg/testrepo",
"fork": false,
"commits": [
{
"author": {
"avatar": "<githube-url>/avatars/u/5?",
"emailAddress": "supportadmin@testing",
"name": "supportadmin",
"username": "supportadmin"
},
"authorTimestamp": 1742906577000,
"displayId": "bf18050",
"id": "bf180504df890b23e828512f5ea1dffb4a5d057c",
"fileCount": 1,
"message": "KAN1-3 2",
"url": "<githube-url>/testOrg/testRepo/commit/bf180504df890b23e828512f5ea1dffb4a5d057c",
"merge": false
},
{
"author": {
"avatar": "<githube-url>/avatars/u/5?",
"emailAddress": "supportadmin@testing",
"name": "supportadmin",
"username": "supportadmin"
},
"authorTimestamp": 1742905420000,
"displayId": "80525ba",
"id": "",
"fileCount": 1,
"message": "KAN1-3",
"url": "<githube-url>/testOrg/testRepo/commit/80525ba81e50e8841403c1e98931ab16595e84c4",
"merge": false
}
]
}
]
}
Was this helpful?