How to apply the limit filter in Bitbucket Server and Datacenter ReST API and query more than the max limit of 1000 results.

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

By default Bitbucket Server and Datacenter ReST API returns 25 results, which can be increased to 1000 using the limit filter. However, for some customers this limit may not be enough, to get the complete result set follow the steps in the solution section of the article.

環境

Bitbucket Server and Datacenter 6.x, 7.x,8.x

ソリューション

Case 1:
To fetch 1000 results, append ?limit=1000 at the end of the Bitbucket Server and Datacenter ReST resource.

:

curl -H "Content-Type:application/json" --user <Bitbucket admin username>:<password> -H "Accept:application/json" -X GET "<BITBUCKET_BASE_URL>/rest/api/1.0/admin/users?limit=1000"

Note: If you are using cURL to run the API call enclose the entire ReST resource in double quotes, in the case of Postman it is not mandatory. 

Case 2:
To fetch all the results

  1. Run the API to get first 1000 results
  2. Note the "nextPageStart" value from the results
  3. set the number from "nextPageStart" to start parameter
    ?start=1&limit=1000
curl -H "Content-Type:application/json" --user <Bitbucket admin username>:<password> -H "Accept:application/json" -X GET "<BITBUCKET_BASE_URL>/rest/api/1.0/admin/users?start=1&limit=1000"





最終更新日: 2023 年 12 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.