Forums

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

BitBucket api GET PR comments returns only 10 latest comments

AlonKaganArgus July 22, 2019

Hi

I am using the following call:

(GET) https://api.bitbucket.org/2.0/repositories/{project}/{repo}/pullrequests/{pr_id}/comments?sort=-created_on

using the new API.

It only returns the latest 10 comments on the PR when rather I want to get them all.

On api 1.0 it did return all. And in the API docs there is no explanation for why only 10 comments.

Can anyone help please?

Thanks!

1 answer

1 accepted

0 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2019

Hi @AlonKaganArgus

This endpoint is paginated, similarly to many other endpoints of 2.0 API. If you need to fetch all comments, you need to follow the links returned in the next property in the response.

You can increase the page size from the default 10 by adding pagelen query parameter to your request, however note that it is capped at 100, and any larger value would return an error.

Hope this helps.

Cheers,
Daniil

AlonKaganArgus July 25, 2019

Thanks!

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events