How can I search an object in all object types?

Özge Özgenç January 4, 2023

I have an object schema on Jira Assets like down below: 

Assets Object Schema.png 

There are devices in object categories and these devices have an owner as an attribute. I want to make a search for a name (owner) to see all allocated devices that name has. One person can have a laptop, phone, and tablet. So I don't want to search each object type by one. How can I search for that owner's name in every object type to see all devices that one person has?

1 answer

1 accepted

1 vote
Answer accepted
Frederic Chartrand
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.
January 4, 2023

Hi @Özge Özgenç 

objectType IN objectTypeAndChildren can be used to list more than one objectType when you do a search. But you'd still need to list all your "main" objectType I think.

Something like :

(objectType IN objectTypeAndChildren(Computers) OR objectType in objectTypeAndChildren("Mobile devices)) AND owner = "Name of the owner"

Let me know.

Have a nice day

Frederic Chartrand

FMX Solutions - Gold Solution Partner

Özge Özgenç January 5, 2023

Hi @Frederic Chartrand
Thank you for your reply.

I tried your solution in both search boxes. But I got an error.

Assets Error.png

Özge Özgenç January 5, 2023

I fixed the syntax error but still, it does not show the all object types it just shows the laptops that the owner has. I want to view other devices at the same time.

Frederic Chartrand
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.
January 5, 2023

I understand why ...

Unfortunately, your AQL query will only search on the objectType you are on.

Since you don't have a "main" folder under which all your different assets are placed, your query only search where you are.

So if you are on "Computers", the query will not search for Mobile devices.

You could recreate your structure to tuck all your assets under a main objectType that could be called "Assets". And do your search on the "Assets" objectType.

I tried to run the query from the main page of Assets where we se all our schemas but it doesn't seem to return any results ...

Same if I try to use the "Search objects" field in the schema (upper right).

What you could do too is to run the query using an Automation rule.

It could be a scheduled rule that send an email. The advantage of a scheduled rule is that you can run the rule manually when you want by going to the Automation rules section of JSM.

The rule would look like that :

Capture d’écran, le 2023-01-05 à 10.22.35.png

The Lookup objects action would be the AQL query

And the last action would be "Send email"with something that could look like that :

Capture d’écran, le 2023-01-05 à 10.22.56.png

Hope this helps.

Like # people like this
Özge Özgenç January 5, 2023

I appreciate your help so much @Frederic Chartrand I understand the solution and I really like the way you solved that. Thank you! 

Malene Vikkelsø September 19, 2023

A sort of fine solution, however adding a Root to your entire object schema to be able to search, might not be a solution because, to still be able to search across object types under a parent, will require the attributes to be placed on parent-level and then inherrited.

This makes sense if all your different object types, sort of seems like the same; it devices with owner, IP, type, etc. But if you also have some object types in the same schema about employees and locations, then it does not make sense of these object types to have IP as an attribute.

It is now possible to hide all unfilled attributes, so the overview is less clustered but they are still then when creating and editing a object.

The only real solution is for Atlassian to fix this. Please vote: https://jira.atlassian.com/browse/JSDCLOUD-9908

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