- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2019 09:54 AM
Hi,
Quick question - in the filter conditions of a report, is there a way to add a dynamic filter of Assigned To is (Dynamic) Not Me?
thanks
Dan
Solved! Go to Solution.
- Labels:
-
Reporting
- 10,374 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 12:20 AM
I thought there should be a way to create a Dynamic Filter Option like this, but unfortunately it's not so easy. You can't just create one similar to the ME dynamic filter such as !gs.getUserID()
As mentioned above you would have to return a list of ALL users excluding the current user, which is overkill and would potentially overflow the filter character limit. There seems to be no way of changing the operator of a Dynamic Filter Option filter, it's always =.
However, you can instead use the javascript: notation on a regular filter to do something similar. e.g.
assigned_to!=javascript:gs.getUserID()
incident_list.do?sysparm_query=assigned_to!%3Djavascript%3Ags.getUserID()
Combining the two methods, is (Dynamic) One of my groups and javascript:gs.getUserID() you get something like the following:
assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^assigned_to!=javascript:gs.getUserID()
incident_list.do?sysparm_query=assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744%5Eassigned_to!%3Djavascript%3Ags.getUserID()
Hope this helps.
~Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2019 12:20 AM
I thought there should be a way to create a Dynamic Filter Option like this, but unfortunately it's not so easy. You can't just create one similar to the ME dynamic filter such as !gs.getUserID()
As mentioned above you would have to return a list of ALL users excluding the current user, which is overkill and would potentially overflow the filter character limit. There seems to be no way of changing the operator of a Dynamic Filter Option filter, it's always =.
However, you can instead use the javascript: notation on a regular filter to do something similar. e.g.
assigned_to!=javascript:gs.getUserID()
incident_list.do?sysparm_query=assigned_to!%3Djavascript%3Ags.getUserID()
Combining the two methods, is (Dynamic) One of my groups and javascript:gs.getUserID() you get something like the following:
assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744^assigned_to!=javascript:gs.getUserID()
incident_list.do?sysparm_query=assignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744%5Eassigned_to!%3Djavascript%3Ags.getUserID()
Hope this helps.
~Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2022 01:12 PM
I recently ran into this situation and this helped me a lot.
I just would like to add that, in order to do this in a report, you have to select the related field "System ID" from the "Assigned to" so you can use the "javascript:" notation.
If you just select the field "Assigned to" in the filter of a report, the field transform in a way that are obligated to select a valid user from the sys_user table and, therefore, unable to type "javascript:xxx".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2023 02:21 PM
@Robert NinnessGreetings!
Will "assigned_to!=javascript:gs.getUserID()" work in a UI policy, too? I'm trying to make a field invisible to all users who is not the assignee. (Tokyo)
Thank you in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2023 10:11 PM
Yes it will. Simply use the condition builder to create the condition: "Assigned to - is not" and then input the javascript javascript:gs.getUserID() into the input box.
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 12:46 PM
Used this today, thanks so much!