Help with filter: Updated by != member of Assignment Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 06:12 AM
I'm having a hard time with what I expected to be a straightforward filter: the request is to list only those Incidents that have been last updated by a user who is not a member of the incident's assignment group.
The first part is easy: Updated by | is not
The challenge I'm having a hard time wrapping my head around is how to correctly express the "member of the incident assignment group" in the filter. Any ideas?
Thanks!
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2021 08:28 AM
So, I was trying to work around this using a scripted filter as described here: https://docs.servicenow.com/bundle/quebec-platform-user-interface/page/use/using-lists/task/t_ScriptedFilters.html
We already use a Style on the Incident table that assigns a blue dot for the case that "last updated is by a member not in the assignment group" and my goal is to be able to display a filtered list of incident table on the logic of "updated by | is not | (a member of the assignment group)." That style is powered by the Script Includes named "IncidentHelperFunctions" which has the following script:
var IncidentHelperFunctions = Class.create();
IncidentHelperFunctions.prototype = {
initialize: function() {
},
getUpdatedByMembership: function(current){
if(!gs.getUser().getUserByID(current.sys_updated_by.toString()).isMemberOf(current.assignment_group)){
return true;
}else{
return false;
}
},
type: 'IncidentHelperFunctions'
};
My attempt to set the filter have included:
Updated by | is not | javascript:IncidentHelperFunctions().getUpdatedByMembership(current) == true
Updated by | is not | javascript: new IncidentHelperFunctions().getUpdatedByMembership(current) == true
And these don't work... the filter turns into "NULL" when run:
Can someone see what I'm doing wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2021 09:36 AM
Hi,
I have the same requirement for the blue dot on the incident list view as you have described here, I have used your script and tried the condition I thought I should write in the Style Value field however it is not displaying any blue dots. Can you please let me know what you wrote in the value field on the Style form please?
Kind Regards,
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2021 07:52 AM
Hi Rob, our style Value field contains this script: javascript: new IncidentHelperFunctions().getUpdatedByMembership(current) == true
Is that the info you needed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2021 09:18 AM
Yes that is what I needed, I had played around with it some more and come up with that order in the end myself but thank you for responding and confirming I had done it correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2021 04:26 AM
Hi - in case anyone still has this issue, a colleague of mine found this and it works! This is to filter to include all 'updated by' that are part of the Service Desk group.
Updated by IS ONE OF javascript:new Arm_groupUtils().getGroupMemberUsernames("Service Desk");