search pull request by commit

I need to search through our history to find out which pull-request merged a specific SHA into our main branch.  I need to find out who approved the pull request for that specific commit.  How can I do this?

the pull request view on the site allows me to filter by author, but that did not show me the commit SHA I found in history (by a specific author).  It is possible that the PR author modified the PR commit message to not include the list of commits (the default behavior), so I am unable to map commits to pull-request approvals.

1 answer

Edit:  Sorry, my answer assumed you were on Bitbucket Server instead of Bitbucket Cloud.   I didn't notice you tagged your questions with Bitbucket Cloud until now.   Nonetheless, it's worth checking out the Bitbucket Cloud REST API to see if it has anything similar.

------

Original answer below:

You might have some luck with pull-requests REST API (official reference docs here).

e.g.,  "pull-requests?at=refs/heads/master&state=MERGED".

The JSON results appear to have some commit-id's in them.  

Live example from my demo server (authenticate as "test" / "test" first):  http://vm.bit-booster.com/bitbucket/rest/api/1.0/projects/bb/repos/b/pull-requests?at=refs/heads/master&state=MERGED

 

p.s.  I'm the original author of the add-on Bit-Booster for Bitbucket Server.

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

26,150 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you