- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 06:01 AM
Hi All
I have to show the incidents which is assigned to groups to which the logged in user is Manager, I am using Dynamic Filters to achieve this.I have written the function in a BR as below
function IamManagerGroups()
{
var mgr = gs.getUserID();
var grMem = new GlideRecord('sys_user_group');
grMem.addQuery('manager',mgr);
grMem.query();
var returnlist="[";
while(grMem.next())
{
returnlist=returnlist+grMem.sys_id+", ";
gs.addErrorMessage(returnlist);
}
returnlist=returnlist+"]";
return returnlist;
}
and DYnamic Filter as below
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2016 02:45 AM
Hi Avinash,
You can achieve this using a simple code in your function.
function IamManagerGroups()
{
var me=gs.getUserID();
var gr = new GlideRecord('sys_user_group');
gr.addQuery('manager',me);
gr.query();
var groups=[];
while(gr.next()){
groups.push(gr.sys_id.toString());
}
return groups;
}
Thanks,
Jagarnath

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 06:06 AM
hi Avinash,
You want to show incident of group manager group to logged in user if he is member of this group rite?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 08:34 AM
Hi Ashutosh
Let Say I am manager for Group A,B,C . When I log in I should see all the INC assigned to these support group , I an trying this using Dynamic Filter, Its not working.
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2016 02:45 AM
Hi Avinash,
You can achieve this using a simple code in your function.
function IamManagerGroups()
{
var me=gs.getUserID();
var gr = new GlideRecord('sys_user_group');
gr.addQuery('manager',me);
gr.query();
var groups=[];
while(gr.next()){
groups.push(gr.sys_id.toString());
}
return groups;
}
Thanks,
Jagarnath

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2016 11:37 PM
try using before query business rule.
in which you can have and or condition and encoded query as well.