Help with a custom asset object field.
Asked by Chase Ketchum:

I have added a couple of custom asset object fields to my issues. One of them links to our People assets and the other is linked with IT assets such as hardware and software.

However, I am facing an issue with the 'Affected Asset' custom field that is linked with my 'IT Assets' asset objects. After setting the Filter Scope to 'Hardware Assets', the field is not pulling up any objects associated with it. I have also attached a picture for your reference.

![Affect Assets Field Config.png](https://community.atlassian.com/t5/image/serverpage/image-id/312449i0C840738B28832D0/image-size/large?v=v2&px=999 "Affect Assets Field Config.png")

Here is a picture of my IT Asset schema tree for reference:

![IT Assets Schema Tree.png](https://community.atlassian.com/t5/image/serverpage/image-id/312450iCB9722FD385FAEF7/image-size/large?v=v2&px=999 "IT Assets Schema Tree.png")

If I remove the Filter Scope entry, all the objects associated with the 'IT Assets' schema appear normally. Am I entering the Filter Scope parameters incorrectly?

Thank you for your assistance.


Answers:
author: Joseph Chung Yin
body: [@Chase Ketchum](/t5/user/viewprofilepage/user-id/5362863) -

Welcome to the community, You have the wrong syntax in your AQL setup - It should be objectType and not objecttype as the objectType is consider as a keyword

Here is a reference link on AQL syntax - <https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/>

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

comments: author: Joseph Chung Yin
body: [@Chase Ketchum](/t5/user/viewprofilepage/user-id/5362863) -

Try this AQL and I believe it will resolve your issue -

objectType in objectTypeAndChildren("Hardware Assets")

The custom field should display all the child setup under the Hardware Assets.

Hope this helps.

Best, Joseph


author: Chase Ketchum
body: ```
objectType in objectTypeAndChildren("Hardware Assets")
```

This AQL syntax entry worked!

Thanks, [@Joseph Chung Yin](/t5/user/viewprofilepage/user-id/396739)


author: Chase Ketchum
body: Thank you for your assistance and ideas. Here are my results:

I had previously tried your suggestions, but it didn't work. I have since corrected the syntax to use a capitalized 'T' in all of my entries, even though some work with a lowercase 't'.

However, the issue persists only with the '**Hardware Assets**' object.

My proposed schema tree, **IT Assets**, is pictured below:

![IT Assets Schema Tree.png](https://community.atlassian.com/t5/image/serverpage/image-id/312518iB553473E2E311705/image-size/large?v=v2&px=999 "IT Assets Schema Tree.png")

Both the top-level '**IT Assets** ' object and the objects that are below '**Hardware Assets** ' like '**Laptops** ' and '**Desktops**' will display correctly in the custom field.

But '**Hardware Assets** ' does not work. I tried using the *objectTypeId* as well.

Could the object be corrupt?

comments: author: Chase Ketchum
body: For those of you following, my goal is to populate all of the 'hardware assets' in the custom object field, using the parent object type 'Hardware Assets'. However, I found a workaround that gives me the same end result. I changed the syntax to include all the child objects under the parent object named 'Hardware Assets'.

* *objectTypeId is (x,x,x,x)*
* where '*x* ' is the object id for *Laptops, Desktops, Phones, Printers*. (see pic of schema tree).

I have not yet tested this hypothesis with other parent objects, but I assume that using the parent object as the objectType will not display all of its child objects.

Can anyone confirm or refute?

[@Joseph Chung Yin](/t5/user/viewprofilepage/user-id/396739) [@Patrick Tripodi](/t5/user/viewprofilepage/user-id/5452664)


author: Patrick Tripodi
body: Hi Chase,   

Might be as simple as capitalising the T in objectType?   

objectType = "Hardware Assets"


Tags: assets

cloud

jira-service-management

jira-service-management-cloud