Hello,
My Jira Cloud instance is linked with Github. I want to access the git commits and branches of Jira issues by using REST API. I checked the REST API of Jira, as well as the links below, but I could not obtain the data over the REST API. How can I get this data?
Links:
- https://jira.atlassian.com/browse/JSWCLOUD-16901
- https://community.atlassian.com/t5/Jira-questions/API-get-branches-related-to-issue/qaq-p/1214220
Hello @Erdem Tuna,
Welcome to Atlassian Community!
Thank you for sharing the feature request and community post.
As mentioned on the ticket, there is no public API to get the development information from Jira issues.
There are some endpoints that are currently, not supported, since they can change without notice.
Can you try using the REST API call below?
https://your-domain.atlassian.net/rest/dev-status/latest/issue/detail?issueId=[ISSUE-ID]&applicationType=GitHub&dataType=repository
Other examples can be found in the description of the feature request:
Kind regards,
Angélica
I am still experiencing some problems accessing the development details of a project.
For example,
On an Apache Fineract issue, there is a pull request linked to the issue under the "links to" section.
Issue link: [FINERACT-1089] Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY in InterestRateChartReadPlatformServiceImpl - ASF JIRA (apache.org)
I am unable to reach the pull request URL from the public API of the Apache Jira
Public API link for this issue: https://issues.apache.org/jira/rest/api/2/issue/FINERACT-1089
Using the id of the issue, I visit the two links below:
https://issues.apache.org/jira/rest/dev-status/latest/issue/summary?issueId=13316289
https://issues.apache.org/jira/rest/dev-status/latest/issue/detail?issueId=13316289&applicationType=GitHub&dataType=pullrequest
I get that Apache Jira doesn't use a GitHub integration app. So the results above are normal.
Is there any way that I would be able to get the linked pull request URL? I guess the main problem here is related to how they link their issues to GitHub.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Emre Açıkgöz ,
Welcome to the Atlassian Community!
First of all let me mention that this question is related to Jira Cloud while you are actually pointing to a Jira Server (on-premise) site. Therefore, there are chances things are working slightly different in your case.
Indeed, the endpoints provided by @Angélica Luz are coming from the below Feature Request for Jira Software Cloud:
There is a similar FR open for Jira Server but it does not list the same workaround. So, there are chances the same endpoints could work in Jira Software Server as well but I am not 100% sure since those are anyway internal endpoints, not officially documented and not officially supported:
Finally, once this has been clarified, please notice that those internal REST API endpoints will only work if you have integrated Jira with Github following the below documentation, while it looks like you are doing something different:
This is because those internal REST API endpoints are just fetching the same information that is displayed in the development panel of an issue, while in your case you don't have the development panel at all. It looks like you just have a remote link to the GitHub PR:
To Summarize:
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got this error "Unauthorized; scope does not match" in this API
"https://issues.apache.org/jira/rest/dev-status/latest/issue/detail?issueId=13316289&applicationType=GitHub&dataType=pullrequest"
so how to solve it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.