The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to get HEAD Git hash with some Crucible REST API call?

Paul Y
February 1, 2019

Problem is:

somebody pushes changes (Git) into review, and I want to get HEAD Git hash. Currently I used EyeQL query like this

rest-service-fe/search-v1/queryAsRows/MyRepository?query=select revisions where in review "SOME-283" order by date desc return csid

and this query returns correct hash as first item in a list until somebody begin to use "git rebase". For example, he can modify some commit with interactive rebase, etc and to push it (with force option, I suppose). After such operation the query returns wrong hash. I tried different conditions (on branch/is head/etc) but it does not help.

Is any way to get Git hash of the HEAD in all cases? May be some undocumented REST call or something else? May be some plugin which can return such information? I mean hash of the last commit which is related to current state of the review, HEAD.

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events