We're updating our terminology in Jira

'Issue' is changing to 'work item'. You might notice some inconsistencies while this big change takes place.

How to use Assets Query Language (AQL)

Assets Query Language (AQL) allows for powerful, dynamic searches in Assets.

Advanced AQL search offers more flexibility than Basic Search, allowing you to conduct specific searches using logical operators (AND, OR), keywords, and dot operations.

To search a single object schema for objects that match a specific AQL statement, use the Advanced AQL search.

Screenshot showing the Advanced AQL Search bar
  1. Go to Assets and select an object schema.

  2. Select the relevant object type.

  3. Select the Objects tab.

  4. Select the Filter icon, then the Advanced AQL tab.

  5. Enter your AQL query.

  6. Select Update filter.

    1. The query results will be filtered based on the selected object type.

Filter objects that appear in a reference attribute

You can use AQL to filter which objects appear in a reference attribute.

Screenshot showing the AQL bar to filter a reference attribute

To create a reference, you must be logged in as a Jira admin or have Object Schema Manager permissions.

From your service project:

  1. Go to Assets and select an object schema.

  2. Select the relevant object type.

  3. Select Attributes.

  4. In the attribute listing, enter a Name and Description.

  5. Under Type, select Object, and under Type value, select the object type you want to reference.

  6. Under Additional Value, select the Reference type for this reference. Learn more about managing references

  7. Select Add.

    1. The objects will be filtered based on the selected reference’s object type.

Filter objects that appear in an object custom field

You can use AQL to filter which objects appear in an object custom field by using the AQL. The Filter scope field filters based on attributes in Assets, while the Filter issue scope field filters based on other Jira fields in the issue.

Screenshot showing the Assets Object Field configuration

To modify an object field configuration, you must be logged in as a Jira admin.

  1. Go to Custom fields in the navigation sidebar.

  2. Find your Assets objects field.

    1. Look for Assets objects under the Type column or search by name.

  3. Select More options, then Contexts and default value.

  4. Select Edit Assets objects field configuration.

  5. Select the object schema you want the field to access from the dropdown.

    1. (Optional) Enter an advanced query in Filter scope (AQL) to filter objects based on their attributes in Assets. Learn more about AQL

    2. (Optional) Enter an advanced query in Filter issue scope (AQL) to filter objects based on other Jira Service Management fields.

    3. (Optional) Select Display a default object when this field appears in a customer portal if you want the Filter issue scope (AQL) field to be pre-filled with a default object in the portal.

  6. Under User interaction, select the attributes users can search for and those that will show on the Jira work view.

  7. Select Save.

Lookup objects using Atlassian automation

You can use AQL to look up objects when using Atlassian automation. The Lookup objects action can be triggered by a specific condition.

Based on the AQL value provided, the Lookup objects action will return a list of objects, which can then be used in other actions with the {{lookupObjects}} smart value. Learn more about Lookup objects

Screenshot showing the how to look up objects using Assets automation

Manage how Assets creates attributes when importing data

You can use AQL to manage how Assets creates attributes during data import. When creating an attribute-type mapping as part of the import, you can use the AQL field to generate references or statuses from raw data by incorporating a placeholder in your AQL statement.

For example, if the Category attribute is a reference, and you want the Data source field to contain the name and link to the referred object (instead of just the name as a string), you could use an AQL statement like Name = ${Category} to create the reference link.

Screenshot showing how to use AQL in imports

To manage an import, you must be logged in as a Jira admin or have Object Schema Manager permissions. 

From your service project:

  1. Go to Assets and select an object schema.

  2. Select Configure, then the Import tab.

  3. Select Edit mapping on your import structure to view the object type mapping.

  4. Select Edit attributes mapping to view the attribute type mapping.

  5. Select a Data source field.

    1. This field specifies where the objects are located in the data file. Attribute mapping will be disabled until a data source field is provided for each mapped attribute. Every object imported into Assets will require at least one data source field to let Assets know where to find the objects. Learn more about the data source field

  6. Select a Destination attribute to map to the data source field.

  7. Optionally, modify default settings for the attribute mapping:

    1. AQL: Enter an AQL statement to create references from data.

    2. Concatenator: Specify an alternative concatenator for this attribute mapping.

    3. Regular expression: Enter a regex that applies only to this mapping.

    4. Base 64: Provide an alternate Base 64 value here.

  8. Select an attribute as the identifier.

    1. This uniquely identifies each object and becomes its new label when created. The identifier is also key for updating data—objects with the same identifier in the destination schema will be updated, while those without it will be created.

  9. Select Add.

Manage how child objects are created when importing data

You can use AQL to manage how child objects are created during a data import. When importing into a parent object type with child types, the Filter data source by AQL field helps assign objects to the correct child type based on source data values.

For example, if you have a parent object type ('Hardware assets') with three child object types ('Phones', ‘Laptops’, or ‘Servers’), you can filter and assign objects to the correct child type based on the data.

Screenshot showing how to use AQL to manage creating child objects in imports

To manage an import, you must be logged in as a Jira admin or have Object Schema Manager permissions.

From your service project:

  1. Go to Assets and select an object schema.

  2. Select Schema configuration, then the Import tab.

  3. Select Edit mapping on your import structure to view the object type mapping.

  4. Select Edit attributes mapping to view the attribute type mapping.

  5. Select Create child mapping and enter the following:

    1. Object type: This will be disabled, as the child object type matches the parent.

    2. Filter data source by IQL: Optional. Use this to filter objects from the data.

    3. Identifier case matching: Disabled.

    4. Missing objects: Choose from:

      • Remove: Only imported entries remain.

      • Update: Non-imported objects will be edited.

      • Ignore: Non-imported objects remain unchanged.

    5. Missing objects outbound references: Choose from:

      • Remove: Only imported references persist.

      • Ignore: Unmatched outbound references remain unchanged.

    6. Empty values: Choose how empty values from the external source should be handled:

      • Use default: Use the value from the import structure.

      • Remove: Remove current values.

      • Ignore: Keep current values.

  6. Select Create.

 

Still need help?

The Atlassian Community is here for you.