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

Hello there,

 In the last line of the query where you have added the or condition for group_list. try using "CONTAINS" or "LIKE" as an operator instead of "IN".

also if still the issue persists try de activating query business rule  and see if the user is able to see the list of incidents to determine whether the issue is from your query in the  widget  or from  the query business rule.

 

Thanks for the reply. 

I tried disabling the business rules and that didn't seem to work. 

I also updated the script to try "CONTAINS" and "LIKE" and that doesn't seem to be working either. 

 

Thanks


Cobee

Hi cobee I missed it

the query you wrote will not work here. you need to create dynamic filters and need to use that dynamic query here.

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_listDYNAMIC90d1921e5f510100a9ad2572f2b477fe4

 

Mark as correct if it helps

Regards Thameem