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,313 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 11:04 AM
Hey,
You will not be able to use current.opened_by in your list view, that's the filter for your business rule.
You can use stuff like:
[Short Description] | is | javascript:testFilterSD()
[Company] | is not empty
[Close Notes] | is | javascript:testFilterCN()
[Assigned To] | is not | javascript:gs.getUserID()
You can also use stuff like URL Filters:
Please modify them accordingly.
URL filter or query parameters are in the format of:
sysparm_query=caller_id%3D46c6f9efa9fe198101ddf5eed9adf6e7%5Epriority%3E3
So this link...
https://demo.service-now.com/incident_list.do?sysparm_query=caller_id%3D46c6f9efa9fe198101ddf5eed9adf6e7%5Epriority%3E3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 11:55 AM
Hi there,
Use the below code and you should get your results.
1. 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'
});
2. In your Incident List or Report choose this
Created By is one of javascript:new groupMember().getMember("Service Desk");
This works for me. Instead of Service Desk, you can give group name of your choice and it will pull all the members of that group. I believe this was your requirement.
Best Regards,
Rahul
Please mark Correct / Helpful if it worked for you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 05:11 AM
Hi,
This works fine with 'Created by' where 'is one of' is possible but what do you do if you want 'Opened by' instead? There's no 'is one of' on 'Opened by' and you can't call a javascript in an 'is' statement.
Best regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2020 10:52 PM
Ahh, I found out. Dot walking to Request > Requested for > User ID where 'is one of' is possible.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2021 11:53 AM