Help with filter: Updated by != member of Assignment Group

JP-ODU
Tera Guru

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!

11 REPLIES 11

JP-ODU
Tera Guru

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:

find_real_file.png

Can someone see what I'm doing wrong?

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

Hi Rob, our style Value field contains this script: javascript: new IncidentHelperFunctions().getUpdatedByMembership(current) == true 

Is that the info you needed?

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.

LMeats
Tera Contributor

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");