Can anyone guide me on using an aql query to get a list of asset objects?
right now i am trying this:
/v1/aql/objects?objectSchemaId=5&objectTypeId=15
however it does not narrow down the return of just the objects that have an objectTypeId of 15.
thanks,
-wade
In case anyone is interestred this is what I got to work
/v1/aql/objects?qlQuery=objectSchemaId=5 and objectTypeId=15
My god, THANK YOU!!
The absolute lack of query examples in the official documentation is frustrating to the point of anger, specially since in IQL the objectSchemaID had to be specified before the actual query.
Thank you, thank you, thank you!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Wade,
First, and most importantly, "Thank you!" for your post. It was the only information I could find referring to the use of the "qlQuery" REST API option.
For anyone else searching, with the assistance of Atlassian Support I was able to sort out my AQL query and perhaps someone may find it useful as well.
I was trying to use the REST API to run a Curl query against the Assets CMDB to find objects that met a criteria where the Serial Number attribute started with a specific text string.
EX: objectSchemaId = 7 AND objectTypeId = 22 AND "serial number" startsWith emea
The short answer was that I did not encode my query properly to be used in a URL. Where ""https://api.atlassian.com/jsm/assets/workspace/{workspaceId}/v1/aql/objects?qlQuery=objectSchemaId = 7 AND objectTypeId = 22 AND "serial number" startsWith emea"" did not work, ""https://api.atlassian.com/jsm/assets/workspace/{workspaceId}/v1/aql/objects?qlQuery=objectSchemaId%20%3D%207%20AND%20objectTypeId%20%3D%2022%20AND%20%22serial%20number%22%20startsWith%20emea"" did work.
I hope others find this information helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good information @Paul Hecker I came across that as well when using the api call in a groovy script. It does not like spaces. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.