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: 

Bitbucket RepositoryService: findAll method returning only 1000 repositories

Anil Mishra
Contributor
December 3, 2019

I need to get all repositories from Bitbucket, and  I am using the RepositoryService .findAll()

repoService.findAll(new PageRequestImpl(0, 10000)

But it is returning only 1000 repos while in fileSystem there are more than that and I have specified the limit  for 10000.

Does this findAll ignores any repositories ?

How can I get all repositories?

 

Thanks,

Anil

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Mikael Sandberg
Community Champion
December 3, 2019

You will have to look at how many pages the response returns and then iterate on that. Have a look at PageRequest.

Anil Mishra
Contributor
December 5, 2019

Hi Mikael, Thanks for your reply.

I did use PageRequest, I used PageRequestImpl with below code snipped

repoService.findAll(new PageRequestImpl(0, 10000)

public PageRequestImpl (int start, int limit)

Constructs a new PageRequestImpl for retrieving a page with limit entries from the specified start index.

 

Am I doing anything wrong here? Can you suggest path forward on this.

Mikael Sandberg
Community Champion
December 5, 2019

There is a hard limit of 1000 by default on the page request, so unless you have changed that in the config file for bitbucket (forgot where it is) your 10000 is being ignored. For the scripts I created using the REST API I always check the pages returned to see if I have to do the call multiple times to get everything.

Like Move Work Forward likes this
TAGS
AUG Leaders

Atlassian Community Events