Really basic AQL question

William Rentfrow June 21, 2023

Disclaimer - I have not worked in Assets all that long....I am trying to do something extremely easy in theory.

I have a simple schema for lookups.  One Object type - Departments - holds 50 departments and the bureau they fall under.

Another object type is Bureau, a list of 6 major Bureaus.

I added  custom field for Bureaus in JSM and put it on the form limiting it to the schema and objecttype=Bureau.  It works as expected.

I added another custom field for Department with Filter scope of objecttype=Departments and Filter issue scope of anyAttribute="(${customfield_10500})"

10500 is the custom field ID of Bureau.

This does not work.  Admittedly the entire approach may be off but all I really want is two drop downs where the 2nd one only displays departments from the selected bureau.  Clearly I'm missing something.

2 answers

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 21, 2023

Hi @William Rentfrow,

Welcome to Atlassian Community!

Try and remove the () around the custom field in the filter scope. Here is an example of how my peripheral field is set up that is filtered based on the selected location.

Screenshot 2023-06-21 at 4.15.22 PM.png 

William Rentfrow June 22, 2023

Thanks for this - I feel like I am really close.  It's definitely the AQL on this line that is wrong - without this I get the full unfiltered list:

Bureau=${customfield_10500}

That's the filter issue scope after I used your update.  To be clear, Bureau is a field on the issue and it's also an attribute in the Asset class.

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 22, 2023

Hmm, I'm wondering if it could be that you left out the whitespace before and after the = sign.

Anyway, if you use the same AQL in Assets and replace the customfield part, do you get a result then?

Btw, here is the article that introduced filter scope, https://community.atlassian.com/t5/Jira-Service-Management-articles/Announcing-Filter-Issue-Scope-for-Insight/ba-p/1737942

0 votes
William Rentfrow June 22, 2023

So @Mikael Sandberg you got me to where I needed to be, missing one thing.  I didn't realize that custom fields are objects with multiple attributes.  The solution was to add .name so it was using the text value.

 

2023-06-22_11-44-57.jpg

Suggest an answer

Log in or Sign up to answer