Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Fetching Git Commits and Branches of an Issue from Jira

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

1 answer

1 accepted

1 vote
Answer accepted

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

Hi @Angélica Luz

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.    

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:

WRONG.jpg

 

To Summarize:

  1. It is normal that you cannot fetch data from the development panel since there is none.
  2. If you want to test whether or not the same REST API endpoints provided as a workaround for Cloud work in Server too, you need to configure the integration with GitHub as explained in Integrating with Development Tools.

 

 

Cheers,
Dario

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

931 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you