Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it possible to make an AQL search using Attribute ID instead of Name?

Krister Broman _Advania_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 29, 2023

As a general guideline we always want to search for an ID instead of a Name whenever we have a function that is intended for long-term / systemwide use.

For example a general JQL query on a custom field with id 12345 could be cf[12345] = searchitem

Is it possible to do the same for AQLs? 

Example: 

Attribute Name: Status
Attribute ID: 1670 

AQL: Status = Operation would be the standard way but instead we would like to use id[1670] = Operation or similiar function just as we can do for JQLs

Placeholders (https://support.atlassian.com/jira-service-management-cloud/docs/use-placeholders-to-replace-information-depending-on-context/ ) looks as if it might be possible to use ids. But i cannot get that to work in AQLs 

Anyone have any information about this?

3 answers

2 votes
Ludwig Bayerl June 23, 2023

Just facing the exact same issue here - using attributes' names in REST's aql but creating / updating objects values with attribute' ids is kind a strange.

2 votes
philippe_puy-ext June 14, 2023

Hi,

I think that you need to turn your attribute into an object if you want to use it this way.

Then the AQL syntax would be something like this:

"Status" IN ("PH-1670")

1 vote
Björn Gullander Eficode July 26, 2023

Unfortunately there is no way to use the attribute ID in the AQL search. You need to use the name of the attribute (with exact spelling).

Placeholders may only be used for inserting values from for example custom fields on the right hand side of the expression. 

AndyS
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2024

What's the syntax of the AQL query to search based on an attribute name then?

Is that documented anywhere for undeprecated calls?

AndyS
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2024

Ah, I've found "attribute name with space" = my_value

but what about searching for an asset with a specific object Id. 
This seems to work at the top level but I have objects used as items for attributes and objectId = xxxx does not seem to return values for those sub-objects. Are they referenced in a different syntax?

 

Both objects appear in the GUI

/jira/servicedesk/assets/object/11021 for the high level object, and 

jira/servicedesk/assets/object/11191 for the low level object

but objectId = 11021 returns object 11021 whereas objectId = 11191 doesn't return anything

Ultimately, I'm trying to figure out the correct syntax for getting an API call to collect info about that lower level asset so that my API queries don't have to collect large volumes of high level object data with lots of unnecessary content

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