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 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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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.

TAGS
AUG Leaders

Atlassian Community Events