JQL - looking for issues based an attribute of connected Asset object

Simon Sahli February 8, 2024

Hi Community,

question related to JQL issue search in combination with an Asset object and their attributes. I am wondering if the following use-case is possible to do with JQL in the JSM cloud.

Our issues are always connected to an "Customer" Asset object (Customer is visible as a field on the issue). This customer Asset object has the "Key Account Manager" as an attribute.
Now I would like to see all issues for a specific "Key account Manager" within an JQL.
I can find the key account manager field in JQL search, but when I set a valid name then no issues can be found.
If I look for the customer object in JQL then the correct issues are displayed.

So my question is, how can I look for issue related to an attribute of a connected Asset object?
Like is it somehow possible or do I need to find another solution.
Plan B could be do copy the asset attribute value into a Jira custom field (I know that this would work).

Thanks in advance!
Cheers,
Simon

2 answers

1 accepted

1 vote
Answer accepted
Uday Kiran Bhaviri
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.
February 8, 2024

You can use AQLFunction in JQL to fetch the issues.

Example: here customField is Assets object custom field in Jira and Account Manager is the attribute of Customer object.

customField in aqlFunction("Customer.\"Account Manager\" = \"Mathias Edblom\"")

Refer to the below article

https://support.atlassian.com/jira-service-management-cloud/docs/assets-jql-functions/

Simon Sahli February 8, 2024

I have seen this article and the example, but which value do I need to use for the "customField" for my situation?


I have tried some variants, but I never got any issues displayed...

Uday Kiran Bhaviri
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.
February 9, 2024

Here custom field refers to the custom field which you must have created in Jira to show the assets values in issues view or edit or create screen

In your case I think  you have mentioned as "Customer is visible as a field on the issue"  so you need to use that field name.

Regards

Uday Kiran 

Simon Sahli March 4, 2024

Hi @Uday Kiran Bhaviri

I did that, but I still do not get any issues as a result of the query. There is no error displayed either, so I probably it just does not find any issues with constructing a query for this use case.
Perhaps you see in the following example what I am doing wrong or if it is perhaps not possible what I am trying to do.

So I have the following query where I want to display all the issues of customers with Gabriella as the Key account manager:
customer in aqlFunction("Customer.\"Key Account Manager\" = \"NameXYZ\"")
AQL_query.png

 

There are multiple customers for which Gabriella is the Key account manager and all these issues should be displayed. There are plenty of closed and open issues connected to this customer. Issues are always connected to the customer, but not directly to the Key account manager.
Customer example:

Customer_KeyAccountManager.png


Do you see why the query displays nothing with this query?
Is there a better way of getting all the issues depended on a specific customer attribute?

Uday Kiran Bhaviri
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.
March 4, 2024

Hi @Simon Sahli 

Is Customer - your custom field name in Jira, Could you also show me the customfield context configuration

Also can you check the JQL like

Customer = "'some thing" 

Just to check whether the configurations are working.

Thank you!

Simon Sahli March 6, 2024

Hi @Uday Kiran Bhaviri

see the following customer Asset field definition:Customer_field_definition.png


And yes you can use JQL for the customer field. Example with looking for a specific customer:

Customer_JQL.png

Anything you can conclude from this situation?
Thanks!

Best,
Simon

Uday Kiran Bhaviri
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.
March 7, 2024

Hi @Simon Sahli 

Add the other attributes other than label in your case 'Key Account Manager' in the configuration in

Allow search filtering by these attributes 

Let's see if it works

Simon Sahli March 10, 2024

Hi @Uday Kiran Bhaviri
thanks for the suggestion. I have added the "Key Account Manager" field to be allowed to search (see printscreen).

I have then run the following AQL query again, but there was still no issue shown as a result:
customer in aqlFunction("Customer.\"Key Account Manager\" = \"NameXYZ\"")


Any other suggestions?

What I find a bit weird is that "Label" has been configured here. Like Label is only used on the issue level, but not in Assets, right?

Config2_Customer.png

Uday Kiran Bhaviri
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.
March 14, 2024

I think you are missing something, if you have support from Atlassian please create a request and check with them. Hope you have all permissions to view all the objects and the referenced objects.

Write AQL to get the customers whose key account manager is "something"

objectType="Customer" and "Key Account Manager" = "something"

And in JQL 

Customer = "'some thing"

open the issue and check the Customer asset is showing other attribute values in view screen.

Simon Sahli March 26, 2024

I got a response from the Atlassian Support now and they could help me solve my request.
This is the AQL I needed for my use-case:
Customer in aqlFunction("\"Key Account Manager\".Name = \"NameXYZ\"")


Basically I needed to use "Name" for the attribute, which is used in the "Employee" object for the name of the employee and to which object the Key Account Manager is referenced to. 

Like Uday Kiran Bhaviri likes this
0 votes
Mathieu Truchot
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.
February 8, 2024

Hi Simon,

This should be possible with the AQL JQL fonction

See related documentation : https://support.atlassian.com/jira-service-management-cloud/docs/assets-jql-functions/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events