Increasing Output from REST API

Patrick Harrold July 15, 2020

I'm trying to query all of my groups. However, the output is only giving 20 results. Is there a way to increase this when using a curl command?

The article (https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-groups/#api-rest-api-3-group-bulk-get) mentions this:

maxResults
integer

The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system property jira.ajax.autocomplete.limit.

But I don't know how or where to set that.

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 15, 2020

Hi @Patrick Harrold 

Have you tried to pass maxResults as a query parameter, which is how you do it when calling the REST API using a URL, such as ?maxResults=100

I believe that 100 is the maximum that can be read in one batch, and that to read more you you make subsequent calls by adding paging.  For example the second call would add on &startAt=100 

 

Best regards,

Bill

Patrick Harrold July 15, 2020

Thanks Bill. That works! I was able to go up to 6000 (what I needed) since maxResults is a 32-bit integer (max of 4294967295 if unsigned)

I don't know why I didn't think about building that parameter into the URL. I kept trying to add it as a parameter for curl.

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2020

I am glad that worked for you, and good learn the maxResults is not universally 100 for everything.  The 100 records for issue pull is to manage performance, no doubt.

Hanna Torany September 7, 2022

@Patrick Harrold How do you build that in URL.

I need to get 1000 objects but i get 25 objects when i try with this link

https://(Base-URL)/rest/insight/1.0/iql/objects?objectSchemaId=13&iql=objectType="systems"&?maxResults=1000

Patrick Harrold September 8, 2022

Hi Hanna,

I don't have record of the exact query but it was using curl. Here is the example from the article I posted above:
curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/3/group/bulk?groupId={groupId}' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'

 

Then you can just append ?maxResults=100 to it

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events