Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,946
Community Members
 
Community Events
184
Community Groups

Using the AQL API to query assets

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

1 answer

1 accepted

5 votes
Answer accepted

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!!

Like # people like this

you are welcome!! 

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.

Good information @Paul Hecker I came across that as well when using the api call in a groovy script. It does not like spaces. :)

Suggest an answer

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

Atlassian Community Events