I am using the REST API's AQL to get a list of all our Assets using the endpoint v1/object/aql
and making a POST to it, for instance with AQL:
"objectSchema = AID AND name STARTSWITH C"
But I am hitting the hard max. of 1000 items pr. query.
So I need to filter further. I know we have a custom field which signals if the assets is "obsolete" (we call the customfield "Udgået") but how do I extend the AQL to include an " AND Udgået = no" ?
Hello @Carsten Johannesen
I would try the AQL with the boolean value as true or false, not yes / no.
So in your case, something like this should be the right direction:
objectSchema = AID AND Name STARTSWITH "C" AND "Udgået" = false
If Udgået is a Boolean attribute, Assets expects Boolean values in that form. Also, because the attribute name contains a special character, I would keep it in quotes. Atlassian’s Assets docs describe Boolean attributes as true / false, and AQL supports filtering on attributes that way.
For the second part, I would not solve the 1000-object problem by splitting everything manually by first letter unless you really have to. The better approach is to paginate your API calls with startAt and maxResults on the AQL endpoint and loop through the result set. Atlassian documents POST /object/aql as paginated, and there is also a total-count endpoint if you want to know the full result size first.
Your option can be if issues are linked to the assets to use connectedTickets(
connectedTickets(Udgaet = no))
Otherwise you will need to see if you can use other attributes on the objects you want to include, seek common ground there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.