How to report on incidents opened by a particular group?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 01:56 PM
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?
- 9,311 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 02:09 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2018 02:10 PM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 09:33 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 10:10 AM
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. 😞