AQL block in automation

Mélanie Liguet
Contributor
December 11, 2024

Hi, 

I have a problem with my AQL query in my automation. I always have the message "Assets field condition failed"

 

When creating a ticket on the portal, I want to check whether the "component" field entered by the customer is gold or silver and production

 

see the AQL query below : 

objecttype = "Components" and name = ${customfield_12488.value} and "classe" in 

OR, GOLD, SILVER, ARGENT) and environment = production

If I execute this query with a hard value, it works, I have 1 result

 

 

Custom field 12488 is an asset object

 

Capture.PNG

 

 

I'm new to AQL, it may be obvious but I can't find the solution.

Thanks for your help

1 answer

2 votes
Tomislav Tobijas _Koios_
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
December 11, 2024

Hi @Mélanie Liguet ,

I see you're trying to use placeholders within the query in automation. However, within automation you might want to try using smart values.

In your example, that would mean replacing 

name = ${customfield_12488.value}

with something like

name = {{customfield_12488.name}}

Other part of the query also seems to be missing one opening parenthesis, specifically when it comes to the part after "classe" attribute.

As for testing AQL, I would suggest navigating to a particular Assets schema and then using Filter > Advanced AQL option to search of issues. Here, I usually 'hardcode' all values just to see if all operators and queries in general work as expected.
After that, I replace those hardcoded values with smart values (when it comes to automation) and test that out.

Also, when it comes to smart values, I would suggest using Log action within the rule to see what you'll get as a return from specified smart values.

Hope this helps.

Cheers,
Tom

Suggest an answer

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

Atlassian Community Events