Sort Insight field (object picker) to present reporter's assets first

David Antebi February 7, 2022

Hi,

I have an Insight field that lists all of the computer objects in my scheme.
Each computer has an Owner attribute, which is another object from type User.

When user creates a new ticket, I want to sort this field and present first at the top of the list, the computers which belong to the creator (Owner attribute == currentUser).

Is there a way to do this?

Thanks

1 answer

0 votes
Peter-Dave Sheehan
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, 2022

I don't think that's possible.

You can filter the object only based on placeholders. You can't adjust the sort order.

Here is a hack you might want to consider:

1) Add a radio button custom field (e.g. "Computers to show") with 2options labeled "All" and "Mine"

2) Add a new text attribute to your computer object type (e.g. "Display Filter") and ensure that all objects always contains the value "All" either via automation or via your import configuration

Change your IQL filter configuration for the Computer custom field to:

objectType = Computer and (Owner = currentUser()  or "Display Filter" = ${Computers to show})

This way, if the user selects Mine ... only objects matching the first half of the parens will be true and only the objects owned by the current user will appear. If the user selects "All", then all objects will be available.

This could be made cleaner if IQL/Placeholder allowed comparing placeholder against literal values. But that's not supported. So we trick the system by using the new attribute.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events