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: 

On the command line, how can I use git to retrieve a list of pull requests and associated users?

David Cash
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!
September 18, 2019

I am hoping to gather some aggregated statistics relating to which user(s) have contributed various commits to any given branch, and which users have reviewed any given pull request.

On the command line, I can use "git log" to retrieve a list of commits to any given branch (such as develop/ which is the branch I am interested in). I can iterate this command line output and retrieve the commit hash, and the username / email who made the commit. 

After that, I can then use the Bitbucket website to view each pull request, but it's a manual process. Is there a git command that lists all pull requests similar to that found on the website under https://...../repos/...../pull-requests/ ?

Thank you very much for any assistance!

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Joao Sgreccia
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2019

Hi @David Cash

Sorry for the late response.
Unfortunately, there isn't a git command to perform exactly what you are looking for.

However, it is possible to use bitbucket rest API to retrieve information about the pull request.

Pull request API:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests#get 

Querying pull requests:
https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-pullreq

Authentication methods:
https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication

Please, do not hesitate to ask if you need any further assistance.

David Cash
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!
September 20, 2019

Thank you very much, your answer was very helpful

TAGS
AUG Leaders

Atlassian Community Events