How to report on incidents opened by a particular group?

Dave Moulds
Tera Contributor

This question was asked in previous releases when you could reference a javascript business rule to filter your results, but has since become unavailable with newer releases.  

We are using Kingston.

So, how would one generate a list of incidents that was opened by a particular group without explicitly identifying all the group members in the filter?  eg. "Opened by" is groupMember of "Service Desk"

Thoughts? 

12 REPLIES 12

sachin_namjoshi
Kilo Patron
Kilo Patron

Create a global business rule with a function to get group names for a given opened by.

 


function groupMembers(grpMember) {
var mbrs = new Array();
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('user', grpMember);
grmember.query();
while (grmember.next()) {
mbrs.push(group.toString());
}
return mbrs;
}


Then your filter would be:
Assigned to is javascript:groupMembers('current.opened_by')

When the filter runs it will resolve to the list of group members and match records where assigned to is anyone in the group.

Regards,
Sachin

sachin_namjoshi
Kilo Patron
Kilo Patron

Create a global business rule with a function to get group names for a given opened by.

 


function groupMembers(grpMember) {
var mbrs = new Array();
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('user', grpMember);
grmember.query();
while (grmember.next()) {
mbrs.push(group.toString());
}
return mbrs;
}


Then your filter would be:
Assigned to is javascript:groupMembers('current.opened_by')

When the filter runs it will resolve to the list of group names.

Regards,
Sachin

Thanks Sachin.

 

How would I create such a filter? 

I am trying to build a report, but I don't see any option which will allow me to leverage the ability to call a business rule via the javascript call.

For example,in my condition selection I use "Opened by" and "is".....but if you try and explicitly enter in "javascript:groupMembers('current.opened_by')" you get "No matches found" and it basically does not permit the freeform text entry.  It wants to match a specific user.

find_real_file.png

 

Also,  just to be clear I was looking for a way to show incidents opened by a specific group. 

For example, show all Incidents opened by any members of the "Network" group.

I tried the above with a Dev instance and used the sample Network group, which I know has sample incident tickets.

The filter and query resulted in zero hits.  😞