Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to get a list of all commits for a given issue via the REST interface?

Reuben A. Popp
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 17, 2018

Good morning,

 

As the subject states, I am looking for a way to retrieve a list of all commits for a given issue via the rest interface for JIRA.  I have seen other examples online, but it would appear that these are either an old version of the api or for another product, eg:

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

If I attempt the above against our server with a ticket of (as an example) ABC-123, I always get an error:  '

{"errorMessages":["An invalid ID was provided: 'ABC-123'"],"errors":{}}

 

Please tell me there's a means to do this via the REST interface.   FWIW, we are running JIRA v7.3.0.

Thanks in advance!
 

1 answer

0 votes
ASweeten
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2018

Hi Reuben,

The problem you are running into is that you are not providing a valid issueID.  An issueID is not the same as an issue key.  ABC-123 is an issue key.  In order to find the issueID of your issue, run the following SQL query against your database: 

SELECT ID FROM jiraissue WHERE issuenum = '123' AND project = (SELECT ID FROM project WHERE pkey = 'ABC');

Be sure to switch out the 'ABC' and '123' with your issue key values.  The output from this will be your issueID.  Plug this value into your REST API call.  Hope this helps.

Cheers
~Andrew Sweeten
Atlassian Support

Suggest an answer

Log in or Sign up to answer