- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 10:25 AM
Hi, I want all the Incidents which were created by each and every member of the group. i tried some script available on community but still facing issue to get all incident not getting accurate result
Thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 10:36 AM
Hi Amrita
To find list of incident opened by people in the group you need to do this
Use the below code
Created a Script Include
Name = groupMember
Client Callable = true
Script
var groupMember = Class.create();
groupMember.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMember: function(grmember){
var mbrs = "";
var gr = new GlideRecord("sys_user_group");
gr.get("name",grmember);
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('group', gr.sys_id);
grmember.query();
while (grmember.next()) {
mbrs += grmember.user.user_name.toString();
if(grmember.hasNext())
mbrs += ",";
}
return mbrs;
},
type: 'groupMember'
});
In your Incident List
Created By is one of javascript:new groupMember().getMember("Service Desk");
Instead of Service Desk, you can give the group name of your choice and it will pull all the members of that group. and when you run the condition it will show you the list of incidents opened by people in the group(in this case it will show all incident created by group member of service desk)
Hope this will be useful for you.
Kindly mark it correct and helpful if it solves your issue.
Thanks and Regards,
Anish Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 10:32 AM
Have you tried this?:
It is creating a dynamic filter with below code that is usable to filter on users that are part of your groups:
If you want only a specific group you van change:
var grpName = gs.getUser().getMyGroups();
To
var grpName =< sys_id of the group you want >;
function groupMembers() {
var grpName = gs.getUser().getMyGroups();
var mbrs = new Array();
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('group', 'IN', grpName);
grmember.query();
while (grmember.next()) {
mbrs.push(grmember.user.toString());
}
return mbrs;
}
Works like this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2020 10:36 AM
Hi Amrita
To find list of incident opened by people in the group you need to do this
Use the below code
Created a Script Include
Name = groupMember
Client Callable = true
Script
var groupMember = Class.create();
groupMember.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getMember: function(grmember){
var mbrs = "";
var gr = new GlideRecord("sys_user_group");
gr.get("name",grmember);
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('group', gr.sys_id);
grmember.query();
while (grmember.next()) {
mbrs += grmember.user.user_name.toString();
if(grmember.hasNext())
mbrs += ",";
}
return mbrs;
},
type: 'groupMember'
});
In your Incident List
Created By is one of javascript:new groupMember().getMember("Service Desk");
Instead of Service Desk, you can give the group name of your choice and it will pull all the members of that group. and when you run the condition it will show you the list of incidents opened by people in the group(in this case it will show all incident created by group member of service desk)
Hope this will be useful for you.
Kindly mark it correct and helpful if it solves your issue.
Thanks and Regards,
Anish Kumar