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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.