I am trying to build a rest query to pull specific object values from our schema.
I can find documentation at:
https://insight-javadoc.riada.io/assets-rest/#aql_objects_get
I need examples of what to put after the /objects in the URL.
Hello @Crystal Rouse
Not sure what you mean by 'examples'. The endpoint documentation describes all the parameters for that endpoint and even provides examples:
The query to determine which objects that should be fetched. For example, objectType = "Computer"
. An empty query means all objects are fetched.
Should the objects attributes be included in the response. If this parameter is false only the information on the object will be returned and the object attributes will not be present
How many levels of attributes should be included. For example, consider object A, which has a reference to object B, which has a reference to object C. If object A is included in the response and includeAttributesDeep=1
, object A's reference to object B will be included in the attributes of object A, but object B's reference to object C will not be included. However, if includeAttributesDeep=2
then object B's reference to object C will be included in object B's attributes.
I am having trouble using the AQL syntax. I am able to return the following:
rest/insight/1.0/aql/objects
rest/insight/1.0/objecttype/1
rest/insight/1.0/objecttype/1/attributes
I need to return the data, I am able to get a list of object and attributes but I need the data. I can't find any good examples.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I don't know what you mean by 'data'.
Asset Query Language (AQL) is a query language like JQL, CQL etc. It returns a set of objects that relate to the attributes of the assets in your Jira Service Management system. Those attributes contain 'data' about the assets.
You haven't provided any examples of any REST API query where you've attempted to form an AQL query, so it's not possible to know what you have or haven't tried so far. Have you read through the AQL documentation that describes the syntax of the language? There are dozens of examples there.
Anyhow, good luck with your learning journey.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am very familiar with AQL.
I am unable to get the Rest query to work and show the data I want. I need an example of how to build the actual Rest query.
So, for example if I want to get all the information from my ObjectSchemaID = 1 and my objecttype=1 and where Status = Active
I can build the AQL in Assets, that is not a problem. I just don't know what the syntax is for after the /rest/insight/1.0/aql/objects
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
aql/objects?qlquery=(objecttypeid == 1 AND "Status" == Active)
You can use all AQL Operators (==/!=/etc...) and also "joins" via Reference Functions as mentioned in the AQL Docs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gordon, thank you for the assistance, but we're still getting errors. The only way we've been able to get any data about our table to be returned is by the following, but it only gives us info about the table and no objects from the table:
I then tried again adding /attributes which returns all the possible fields and associated metadata, but it still does not return the actual data in the table.
We've tried many variations of what you sent with no success. We've combed through the documentation and can't get anything to return the data in the table.
If you have any further advice, we'd greatly appreciate it. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The full URL should be:
https://api.atlassian.com/jsm/assets/workspace/{YOURWORKSPACEID}/v1/aql/objects?qlquery=(objecttypeid == 1 AND "Status" == Active)
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.