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

Get commits info of a JIRA issue using REST API

Nikhil k November 30, 2015

I am not seeing any commit info in json that I am getting.

https://(jira-instance)/rest/dev-status/latest/issue/detail?issueId=(issueid)&applicationType=stash&dataType=(pullrequest or branch>)

I get only branch, pull request and stash instance info only from these. I also don't see commit info by using

https://(jira-instance)/rest/api/2/issue/(issueid)

Is there anything that I am missing here. Any help will be very useful here

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2015

Hi Nikhil,

 

exploring rest, finally I found the correct rest, on JIRA side, that provides u more information about commits. There's a specific dataType ("repository") that provides you all information you need :

/rest/dev-status/1.0/issue/detail?issueId=30956&applicationType=stash&dataType=repository

 

Let me know if it helps.

Regards,

Fabio

Nikhil k November 30, 2015

Perfect. Thanks a lot. I could only see pull req and branches. is there a documentation for dev-status rest links? I couldn't find it anywhere

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2015

It is an internal API so no documentation is provided. Using the rest you can see all the scpecif commits related to the provided issue id. Regards, Fabio

Nikhil k December 1, 2015

anyways it is working thanks a lot. it really helped

Rich Liebling November 24, 2016

Hi Fabio,

This was very helpful to me.  We are using github integration, so i changed applicationType=stash to applicationType=github and i get commit info.  But, i am not seeing pull request information.  Ideally, i'd like to get the Github ID's for the pull requests associated to this JIRA issue.  Is that possible?  Thanks!

1 vote
Harish R June 10, 2019

Even I am getting the same issue, can any one suggest me what is missing.

 

{"errors":[],"detail":[]}
Harish R June 10, 2019

Please suggest is there any api to get the development fields list which gives commits data. I need in one single api which gives the details of all fields along with development field.

API is - tickets created in one sprint gives the ticket info and all other stuff, can we get development field data along with this.

Below is the API which gives tickets present in each sprint. 

/rest/agile/1.0/sprint/{sprintId}/issue?maxResults=1000 

0 votes
Sandeep K Voruganti April 10, 2019

Hi Vipul,

 

 

https://onejira.verizon.com/rest/api/2/issue/JiraID  

run this u will get issue ID the u can run u r url , u will get the required result

0 votes
VIPUL AGARWAL January 22, 2019

Hi @Fabio Racobaldo _Herzum_

I am using this link:

https://jira2.####.com/rest/api/2/issue/abcd-1234

where, /rest/api/2/issue/{issueId}

is the REST API to get the details, obtained from the documentation: https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-getIssue

I am getting all the desired details from that JIRA like the client viewable, obligations, Lifecycle step, description etc. but I am not able to get the details form from the Development Panel which includes the commits and the reviews.

Now for the development panel, I used

https://jira2.####.com/rest/dev-status/1.0/issue/summary?issueId=abcd-1234

I have tried with issueId, the external key as well as issueKey but the same output is displayed.
Output:
{
    "errorMessages": [
        "An invalid ID was provided: 'abcd-1234'"
    ],
    "errors": {}
}

Is there any API which can help me fetch the details from the development panel?

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2019

Hi,

you are using an incorrect URL (use detail instead of summary and use issueid and not issue key)

/rest/dev-status/1.0/issue/detail?issueId=30956&applicationType=stash&dataType=repository

 

Regards,

Fabio

VIPUL AGARWAL January 23, 2019

Hi @Fabio Racobaldo _Herzum_

For our JIRA, we have either the Issue key like: ABCD-1234
or the External Key like: 1-234567890

https://jira2.####.com/rest/dev-status/1.0/issue/detail?issueId=ABCD-1234&applicationType=stash&dataType=repository

For the above link, I tried with the issuekey/externalkey.
I am not getting any result.

What is your definition of issueId? Maybe we might have some other thing which can be mapped with the issueId.

Where am I going wrong?

Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2019

Each issue has a key ABC-123 and an id (long that identifies issue over JIRA instance).

You can retrieve issue id using the following rest api : https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/issue-getIssue

Using key you will obtain all issue information including ID.

Regards,

Fabio

VIPUL AGARWAL January 23, 2019

@Fabio Racobaldo _Herzum_

I tried with that too, considering it might be the id for my issue.
Still not getting the desired output.
The obtained output is:

errors: []
detail: []

Note: The JIRA which I use, I can simply browse through issues without login.
I get various details for that issue.
Once I login, I get all the details along with the development panel for that issue, else it's not available without login.

Like Dmitry Vakarin likes this
Kavya Sai February 26, 2019

Even I got same output. What could be the reason for this?

Like Dineshmathiazhagan likes this
Dineshmathiazhagan April 9, 2019

I guess you are trying with Jira ID as issue ID if so correct it provide issue ID every jira ticket has an issue ID 

eg- /rest/dev-status/1.0/issue/detail?issueId=15937&applicationType=stash&dataType=repository

0 votes
Sandeep K Voruganti May 22, 2018

Hi Guys ,

 

I GOT IT FINALLLLY ,

 

this is a 2 step process 

https://(jira-instance)/rest/api/2/issue/(JIRA-ID)

in the response u see issueId(sample 3578199)  use the issue Id in the below url  and u r done 

 

https://onejira.verizon.com/rest/dev-status/latest/issue/detail?issueId=3578199&applicationType=stash&dataType=repository

0 votes
Katie Bell October 26, 2017

This isn't working for me - none of the urls mentioned work on my Jira Server 7.4 with DVCS connection to GitHub Enterprise. I've tried applicationType=github and applicationType=githube

I just get a 500 with a Java null pointer exception on the applicationType.

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2015

Hi Nikhil,

 

the rest api that you used on JIRA side provides you main information about pull request. If you want to retrieve detailed information you need to use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits on stash side. More information availbale here https://developer.atlassian.com/static/rest/stash/3.0.1/stash-rest.html#idp266256

Hope this helps.

 

Regards,

Fabio

Nikhil k November 30, 2015

Thanks Fabio for the information. I can get commit info from the STASH side. The fact that I can see commit list, branch list, pull req list in JIRA issue page itself I thought I can get all relevant info using JIRA api link but I can get every info other than the commit list. I thought I was missing something. If I could get the commit info in JIRA api then I could've mapped things easily. Is there a REST endpoint to get this info in JIRA

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events