Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to write an AQL query that will display one object or multiple objects based on the query

Tim Hall
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!
October 8, 2024

Here is the use case. On our portal we want have a custom field that will show the products they have purchased and not all of the products we offer. I have figured out how to do the first part. The only issue I am running into is if it is a new customer we want to show all the products. Is their a way to do with AQL.

I was wondering if inbound reference would work?

This was my first attempt of doing that:

objectType = "Products" AND "Company" = ${customfield_10234.label} OR object HAVING inR()

The only issue that query shows all the products.

If I do this query it will show the product or products associated with the customer.

 

objectType = "Products" AND "Company" = ${customfield_10234.label}

1 answer

0 votes
Tobias H
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.
October 8, 2024

Hi @Tim Hall!

To me it seems like you have to different kinds of situations:

1. Existing customers selecting their purchased products

2. New customers browsing all products

How I would solve it would be to just have two different custom fields, one that filters and the other that doesn't, and then use a dynamic form to have the user check what they want to do (Existing vs New)

Is there a special reason for you to keep it all in the same field? Or would you just prefer it to be as light of a form as possible?

Tim Hall
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!
October 8, 2024

I was thinking what you're recommending was the solution and it was to try to keep the form as possible. Plus I was wondering if you could even do what I am asking with AQL.

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