Getting Git information from Jira API

Richard Winslow June 7, 2021

I am struggling to get Git commit information out of Jira using the Rest API. I am using this URL:

https://<my instance>/rest/dev-status/latest/issue/detail?issueId=48912&applicationType=GitHub&dataType=repository

And I get the following:

{"errors":[],"detail":[{"repositories":[],"_instance":{"name":"GitHub","baseUrl":"https://github.com","type":"GitHub","id":"com.github.integration.production","typeName":"GitHub","singleInstance":true}}]}

Any help appreciated. I have searched the community and think the above should work.

 

 

3 answers

0 votes
Hyrum Steffensen _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 8, 2021

Hello Richard,

If you are able to use the REST call from a browser, try capturing it using Postman interceptor. See documentation here.

Regards,

Hyrum

0 votes
Richard Winslow June 7, 2021

When I use the summary URL, I get a response but it is all blank. 

 

https://<my instance>/rest/dev-status/latest/issue/summary?issueId=48912&applicationType=GitHub&dataType=repository

 

{"errors":[],"configErrors":[],"summary":{"pullrequest":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":"OPEN","dataType":"pullrequest","open":true},"byInstanceType":{}},"build":{"overall":{"count":0,"lastUpdated":null,"failedBuildCount":0,"successfulBuildCount":0,"unknownBuildCount":0,"dataType":"build"},"byInstanceType":{}},"review":{"overall":{"count":0,"lastUpdated":null,"stateCount":0,"state":null,"dueDate":null,"overDue":false,"completed":false,"dataType":"review"},"byInstanceType":{}},"deployment-environment":{"overall":{"count":0,"lastUpdated":null,"topEnvironments":[],"showProjects":false,"successfulCount":0,"dataType":"deployment-environment"},"byInstanceType":{}},"repository":{"overall":{"count":0,"lastUpdated":"1970-01-01T10:00:00.000+1000","dataType":"repository"},"byInstanceType":{}},"branch":{"overall":{"count":0,"lastUpdated":null,"dataType":"branch"},"byInstanceType":{}}}}

0 votes
Hyrum Steffensen _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2021

Hello Richard,

This Atlassian Community post suggests using "details" instead of "detail" in the REST url.

Regards,

Hyrum

Richard Winslow June 7, 2021

With "details" I get back:

{"errors":[],"detail":[]}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events