Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

AQL Query Across Multiple Object Types Using Attributes and Custom Field Reference

Sathishkumar S
Contributor
July 20, 2026

I'm trying to build an AQL query without restricting it to a specific objectType, and instead query objects based on attribute values.

My use case is to search across multiple object types using two attributes:

AQL
"Attr1".Name = "SOME TEXT"
AND
"Attr2".Name = ${customfield_XXXXX.label}

Observations

  • The first condition works as expected:

    AQL
    "Attr1".Name = "SOME TEXT"

    It returns matching objects across different object types

  • However, when I add the second condition using the custom field reference:

    AQL
    "Attr2".Name = ${customfield_XXXXX.label}

    the query does not return the expected results.

Question

Is there any limitation when using a Jira custom field variable within an AQL query that is not scoped to a specific object type?

Has anyone successfully used a custom field placeholder such as:

AQL
${customfield_XXXX.label}

for attribute matching across multiple object types? If so, are there any prerequisites or alternative syntax that should be used?

Any guidance would be appreciated.

3 answers

1 accepted

0 votes
Answer accepted
Sathishkumar S
Contributor
July 29, 2026

Observation regarding Assets AQL validation in Forms Designer vs JSM Portal

I initially thought there was an issue with my AQL query because the results were not being filtered correctly during testing.

However, after further investigation, I realized the AQL itself was working as expected.

The confusion came from where I was validating the query:

  • When testing the field in the Forms Designer preview, the Assets field displayed irrelevant results or nearly all available objects.
  • When accessing the same form through the actual Jira Service Management Customer Portal, the field behaved correctly and showed only the expected filtered objects.

So, in my case, the issue was not with the AQL syntax or field configuration. The behavior in the Forms Designer preview did not accurately reflect the filtering behavior seen in the live portal.

Has anyone else observed differences between the Forms preview and the actual JSM portal when using dependent Assets fields and AQL filters?

3 votes
Trudy P Claspill
Community Champion
July 20, 2026

Hello @Sathishkumar S 

Welcome to the Atlassian community.

What is the context of running this query? Are you within and Automation flow? If so, please show us the flow in its entirety. Is it an AQL within a Custom Asset Object field? If so, please show us the entire configuration for the field.

Are the object types all within a single schema, or are you also trying to search across schemas?

What type of custom field is customfield_XXXX? That syntax is a reference to a custom field within Jira, vs. Assets, so there should be a custom field type/

Sathishkumar S
Contributor
July 20, 2026

Hello @Trudy P Claspill 

Thank you for your response.

  1. The AQL query mentioned here is not being used in an Automation rule. It is being used within a Custom Asset Object Field.

  2. All the object types involved are located within the same Assets schema.

  3. The referenced field (customfield_XXXXX) is also an Assets custom field. We are attempting to use its selected value as a dynamic filter in the AQL query.

The first condition works as expected and returns objects across multiple object types. However, the part referencing the Assets custom field value does not seem to be evaluated correctly.

Any insights on whether there are limitations or specific syntax requirements when using an Assets custom field reference in an AQL query for a Custom Asset Object Field would be greatly appreciated. Thank you!

Like • Susan Waldrip likes this
Sathishkumar S
Contributor
July 20, 2026

Additional Info:

When i tried with hard coded value instead of customfield_xxx reference, it worked as expected on Filter scope. 

Rudy Holtkamp
Community Champion
July 20, 2026

Could you post a screenshot of the context of the field

Sathishkumar S
Contributor
July 20, 2026

Screenshot 2026-07-21 121723.png

Trudy P Claspill
Community Champion
July 21, 2026

Is the filter you are trying to address the Filter work item scope (AQL) filter in your screen image?

If so, do I understand that you have verified that if it contains only the first part, then you get the correct list?

objectType=${customfield_10866.label}

If so, do I understand that it is when you add the second part you end up getting no results at all?

AND "Instance" = ${customfield_10734.label}

If I have that correct:

  1. Is "Instance" an attribute that is available in all the objects you get from the first part of the filter?
  2. What type of attribute is "Instance"?
  3. Does the Asset Object field customfield_10734 support selection of multiple asset objects?
  4. You said when you hard coded the value the filter worked. What value did you use instead of the placeholder? Was it the Name of the Object specified in the second Asset Object field?
  5. Have you confirmed that the Label option is set to the attribute of the second object that contains the data that will match to data in the "Instance" attribute? If it is the Name of the second object that matches to the "Instance" attribute, make sure that the Label option is set to the Name attribute of the second object.

Screenshot 2026-07-21 at 10.01.16 PM.png

1 vote
Rudy Holtkamp
Community Champion
July 20, 2026

hi @Sathishkumar S ,

Did you try to add quotes, like this:

"Attr2".Name = "${customfield_XXXXX.label}"

 

Sathishkumar S
Contributor
July 20, 2026

Hi @Rudy Holtkamp ,

 

Yes, tried with quotes but ends up with Syntax error.

Even with other combinations like moving the query to Filter Scope to Filter Issue Scope. 


Like • Susan Waldrip likes this
Rudy Holtkamp
Community Champion
July 20, 2026

I'm looking at some of my asset fields. Which is used to find laptops that are assigned to a department. The department is set in customfield_10102.

So maybe this gives you an insight:

In Filter scope (AQL)objecttype = Laptops

In Filter work item scope (AQL): assigned IN ($customfield_10102)

Like • Susan Waldrip likes this
Rudy Holtkamp
Community Champion
July 20, 2026

I've taken a look at the screenshot.

Maybe change the Filter work item scope to:

objectType = ${customfield_10866.label} AND Instance in ($customfield_10734.label})

Like • Susan Waldrip likes this
Sathishkumar S
Contributor
July 20, 2026

Suppose if the object Type to get from the customfield instead of hardcoded value as Laptop. That is my use case (one part). 

Like • Susan Waldrip likes this
Rudy Holtkamp
Community Champion
July 21, 2026

What is customfield_10866 for type of field, what values does it contain?

If it is another object and you want to get the type and use it in a second field, you can use:

objectType = ${customfield_10866.objecttype} AND 
Instance in ($customfield_10734.label})

 

Like • Susan Waldrip likes this
Sathishkumar S
Contributor
July 21, 2026

Even this query not working. Listing down all the objects in the schema

Screenshot 2026-07-21 124548.png

Like • Susan Waldrip likes this
Sathishkumar S
Contributor
July 21, 2026

Syntax Error, when using objecttype instead of label

Screenshot 2026-07-21 200534.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events