getAssetsFromAQL()

Text list

This function returns the key(s) of asset object(s) returned by the specified AQL query (Assets Query Language). In case the specified AQL returns an empty result, null is returned. In case the specified AQL is not valid, an error occurs. 

Bash
getAssetsFromAQL(aql) #Output: Text list

Examples

Parser expression

Description

Bash
%{getAssetsFromAQL("objectType=Phones")}

This example returns the key(s) of the asset object(s) with the object type "Phones", e.g.:

PTAS-1, PTAS-2

Bash
%{getAssetsFromAQL("\"OS Version\" = \"macOS Ventura\"")}

This example returns the key(s) of the asset object(s) for which the "OS Version" attribute is equal to the value "macOS Venture",e.g.:

ITSM-42

Bash
%{getAssetsFromAQL("object HAVING inboundReferences(key = " + %{issue.cf12566} + ")")}

This example returns the key(s) of the asset object(s) for which the incoming reference is the object from an asset object custom field with a single object, e.g.:

ITSM-39,ITSM-40,ITSM-41

Additional information

Parameters used in this function

Parameter

Input (data type)

Description

aql

text

Text containing a valid AQL expression.

warning Double quotation marks in AQL have to be escaped with backslashes, e.g.:

Usually AQL would look like

"OS Version" = "macOS Ventura"

Using it within getAssetsFromAQL()

\"OS Version\" = \"macOS Ventura\"

Output

This function returns a text LIST

(books) Use cases and examples