Hitting 1000 result limit when querying a given object type in Assets

Ryan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2024

I'm attempting to fetch all objects of a given type in Assets. We have 5000+ objects of the type "Computer" in our database, but when we query this object type via the API, the total returned is 1000. 

 

Query route:

 

The post body:

  • {"qlQuery":"objectType = \"Computers\""}

 

Response:

 

  • {
        "startAt": 0,
        "maxResults": 25,
        "total": 1000,
        "values": [...]
    }

 

This link indicates the objectType AQL should return all objects of a given type, but after paginating through the results, it stops at 1000. Is the API limited to 1000 results? Is there a workaround or another route to fetch all devices via the API if so?

1 answer

1 accepted

4 votes
Answer accepted
julia_gracia
Contributor
December 5, 2024

Hi Bakonis you need to use the startAt parameter to made in your case 5 api calls or as many as you need.

Something like this:

- api call var = /object/aql/totalcount

- for i = 1 i <= var i++   /object/aql?startAt i 

 

Ryan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 5, 2024

Thank you! That's what I needed. 

Suggest an answer

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

Atlassian Community Events