Group List widget

Cobee
Tera Expert

Hello, 

We are looking at creating a widget on our service portal that will include all incidents where the user is on the watchlist of the incident or part of a group in the group list field. 

This is working for the end users that are included in the watchlist, But not for the users that are part of the group in the group_list field. 

I have configured a simple list on the portal with the following filter condition. 

Any input on why this currently isn't functioning would be appreciated. 

Thanks

Cobee

 

 

find_real_file.png

 

Also I have cloned the "incident query" before business rule to include the group_list field. 

restrictIncidents();

function restrictIncidents() {
	if (!gs.hasRole("itil") && !gs.hasRole("sn_incident_read") && gs.isInteractive()) {
		//Do NOT restrict Incidents if SPM premium plugin is active AND user has the service_viewer role.
		if (GlidePluginManager.isActive('com.snc.spm') && gs.hasRole('service_viewer'))
            return;
		var u = gs.getUserID();
		var groups = gs.getMyGroups();
		current.addQuery("caller_id", u).addOrCondition("opened_by", u).addOrCondition("watch_list", "CONTAINS", u).addOrCondition("group_list", "IN", groups);
	}
}

 

6 REPLIES 6

Thameem Ansari
Giga Guru
Giga Guru

you need to take your dynamic query from the filter refer the below screenshot

find_real_file.png

 

please use the below query and it will work for you

active=true^group_listDYNAMICd6435e965f510100a9ad2572f2b47744^ORwatch_listDYNAMIC90d1921e5f510100a9ad2572f2b477fe

 

Mark as correct if it helps

Regards Thameem

Cobee
Tera Expert

I was able to find the solution to the group_list portion of this by following the steps in this article. 

 

https://community.servicenow.com/community?id=community_question&sys_id=b2378b29db1cdbc01dcaf3231f9619f8

 

Thanks