Forums

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

How can I extract all the commits in a pull request using bitbucket API and the pull request ID?

Chouhei Ngamba Ngangom September 12, 2022

I am using this api call

https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits

My first question -

 1. The response does not have the commit hash as shown in the BitBucket UI of the pull request. How to fix this? The pull request Id is correctly passed to the api call.

2. How can I filter only the commit hash that are not merged from the response?

 

Thanks.

 

1 answer

1 accepted

0 votes
Answer accepted
Chouhei Ngamba Ngangom September 12, 2022

I am able to filter out the commits by using the 'message' string in the json response.

However, for pull request with having more then 10 commits, I am not able to get all the commits. How can I request all the commits with one api call and is it possible?

Thanks 

Chouhei Ngamba Ngangom September 12, 2022

Found in this link

https://community.atlassian.com/t5/Jira-Service-Management/Retrieve-paginated-results-startAt-and-maxResults/qaq-p/1928716 

but got the answer here pagelen adding 

?pagelen=100

at end of url is the working solution in my case!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events