Forums

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

how to retrieve all pull request commits except merged commits using Bitbucket rest api?

akota January 23, 2019

Hi, I trying to get all commits without merge commits. I used merges=exclude query parameter but it doesn't work. i'm getting all commits.

curl -H 'Authorization: Bearer <tocken>' -H 'Content-type: application/json' -X GET https://bitbucket.abc.com/rest/api/latest/projects/<proj-name>/repos/<repo-name>/pull-requests/<pullrequest-id>/commits?merges=exclude

I'm using this api call but which returns all commits.

please suggest me a solution how to achieve this. 

1 answer

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Champion
January 23, 2019

merges=exclude can only be used with /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits. You can then get the pull requests that a specific commit is part of by using /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests

akota January 23, 2019

Got it, thanks for your reply.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events