
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2017 08:02 AM
Hello, I am writing a report and I would like to use the condition builder to check if the Caller is a member of a certain group.
Table: Incident
Condition: Caller - Is Member Of - Groupname
I know that I probably need to build javascript class to call within the condition. How can I build this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2017 08:57 AM
You will need to create a new client callable script include
Script include:
Name:GetCallerIncidents
clitn callable: true
var GetCallerIncidents = Class.create();
GetCallerIncidents.prototype = Object.extendsObject(AbstractAjaxProcessor, {
callerGroup: function(group){
var mem=[];
var id=[];
var grmem= new GlideRecord('sys_user_grmember');
grmem.addQuery('group.name',group);
grmem.query();
while(grmem.next()){
mem.push(grmem.getValue('user'));
}
var gr= new GlideRecord("incident");
gr.addQuery('caller_id','IN',mem.join());
gr.addActiveQuery();
gr.query();
while(gr.next()){
id.push(gr.getValue('sys_id'));
}
return id.join();
},
type: 'GetCallerIncidents'
});
Now in your report use this
sys_id IS ONE OF javascript: new GetCallerIncidents().callerGroup('your exact group name goes here');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 12:17 PM
make sure client callable is checked also if you are adding to a field then just use javascript: new GetCallerIncidents().callerGroup('your exact group name goes here');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 01:03 PM
I tried that but did not work, with the group name and the sysid of the group too.
So, i am doing this on the list, in the "field style".
What i need to do is to see that the value for the field opened_by matches with a group that he is in.. if he is, then put an image or some background color....