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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

0 votes

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.

Thank you very much, your answer was very helpful

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,894 views 0 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you