Find your assets with AQL
10 min
By the end of this lesson, you'll be able to:
- Find objects using different search methods
- Write basic AQL queries
- Describe the purpose of AQL dot notation
- Describe the purpose of aqlFunction()
How do you search for assets?
Assets offer multiple ways of searching an object schema for object types and objects.
👇Click the boxes below to learn more about different search methods.
Bulk update assets from your search
When search results are returned from the search for objects, you can perform bulk actions on multiple items by selecting an action from the Bulk menu. You can select specific objects from the search results, further limiting the objects to be targeted by the bulk action.
👇Watch this video to see how to search using AQL.
Assets Query Language (AQL) basics
AQL is a query language similar to Jira Query Language (JQL) that’s used throughout Assets.
There are many uses for AQL:
- Search objects: Write queries to return one or more objects.
- Automation: Determine the objects to be affected by automation rules.
- Configure custom fields: Determine which objects to show in a field.
- Attribute filters: Limit possibilities when setting values in an attribute.
- Enhance JQL: Combine AQL with JQL to form advanced queries.
There are some basic syntax rules for AQL
👇Click the boxes below to view some syntax rule examples.
Let’s explore some sample queries!
AQL allows for more precise and complex queries, enabling you to filter and find assets based on specific criteria and attributes. It supports queries with multiple conditions, logical operators, and nested queries, allowing you to perform precise advanced searches that are otherwise not possible.
👇Click the tabs below to see some sample AQL queries.
Find object with Name "Jira Service Management"
- Name = "Jira Service Management"
Wildcard text search - Find objects containing "Jira"
- Name LIKE "Jira"
Find all objects of object type "Business Service"
- objectType = "Business Service"
Find objects where Operating system is either Linux or Windows 10
- "Operating System" IN ("Linux", "Windows 10")
What are some AQL functions?
👇Click the tabs below to see a list of relevant AQL functions.
- now()
- startOfDay()
- endOfDay()
- startOfWeek()
- endOfWeek()
- startOfMonth()
- endOfMonth()
- startOfYear()
- endOfYear()
Syntax of relative date functions like startOfWeek() is slightly different from JQL.
"End Date" < startOfWeek(-2w)
This finds objects with an "End Date" later than Monday two weeks ago.
👇Watch this video to explore some AQL functions.
AQL dot notation
Basic AQL queries address objects and attributes directly. But to access referenced objects, AQL dot notation must be used, which enables queries to traverse a chain of referenced objects using outbound references. Queries will return information based on objects referenced by the parent object.
Dot notation uses the syntax: <attribute>.<attribute> <operator> <value/function>
This enables the query to return information based on objects referenced by the parent object.
Let's explore an example of dot notation!
Given this configuration:
- The Employee object type has a referenced attribute called Belongs to Department.
- The Belongs to Department attribute references the Department object type.
👉 Try it out: Write a query that returns all employees in the HR department.
👇Click the boxes below to view some more examples of dot notation.
👇 Watch this video to explore more advanced AQL searches.
Assets custom fields in Jira
You can search for Assets custom fields from the Jira work item navigator.
When searching for work items in Jira's work item navigator, you can also search for Assets custom fields.
Assets supports a JQL function called aqlFunction, which allows you to embed AQL queries in JQL using the basic search. This allows you to extend your JQL search by adding more conditions or further filtering the results based on the Assets database (such as attributes of Assets objects).
Switch to Advanced search JQL view to see the resulting query, which includes aqlFunction() to embed the AQL condition.
👉For example:
- "Business Service" in aqlFunction('Name="Email Service”')
- "Business Service" in aqlFunction('Importance = "Critical"')
In the last example, we look for work items that are only connected to a critical service. The aqlFunction() extends the search by adding more conditions.
👇Watch this video to see how to search work items using AQL.