-
Type:
Bug
-
Resolution: Timed out
-
Priority:
Low
-
Component/s: Assets - AQL
-
1
-
Minor
Issue Summary
When using an AQL Query for Assets, if square brackets are included, it can sometimes results in strange behavior where some objects are returned, but others aren't.
Steps to Reproduce
- Navigate to your Assets on your Site then > Object Schema > Object Type.
- Click the * Advanced* link to switch to advanced AQL view.
- Enter this AQL, replacing the Object Key placeholders for actual Object Keys in the Object Type:
key IN ([ABC-123,ABC-124])
- See that the formatter has formatted this Query into:
key IN ("[ABC-123","ABC-124]") - Try this AQL Query instead, as a test:
key IN ("[ABC-123]")
Expected Results
No object is returned when the number of objects is equal to 1.
Neither object is returned when the number of objects is equal to 2.
All objects except the first & last are returned when the number of objects is greater than 2.
Actual Results
No object is returned when the number of objects is equal to 1.
The first object is returned, but not the last, when the number of objects is equal to 2.
All objects except the last are returned when the number of objects is greater than 2.
Workaround
Adjust your query to not include square brackets.
One method, in Automation, is to set the Smart Value to a Variable using the Create Variable Action, then strip out the square brackets using the replaceAll() Smart Value function.
Notable Occurrences:
Because Smart Values in Automation for Jira return Asset Objects via their Keys, and the lookupObjects Smart Value will do this in the form of a JSON Object such as [ABC-123,ABC-124], using that Smart Value to lookup other Objects in an AQL Query often results in the last object not being returned despite the rest of them being returned.
In other words, if the Action Lookup Objects using Keys from a prior Lookup Objects via the Smart Value, it often results in an incomplete set of results being returned.