
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 09:12 AM
Dear All,
I need to notify the Assignment group Manager every week once when the assigned to member of that group is inactive.
I tried using a scheduled job with a script and the events. However, the notifications is not getting triggered at all.
Any suggestions would be of great help.
Thanks
Shan
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2018 12:41 PM
Try this code. Now the event and notification should be on group table
var grGroup = new GlideRecord('sys_user_group');
grGroup.addQuery("manager.active",true);
grGroup.addQuery("active",true);
grGroup.query();
while(grGroup.next()){
var arr=[];
var inc= new GlideRecord("incident");
inc.addQuery('assigned_to.active',false);
inc.addQuery('assignment_group',grGroup.getValue('sys_id'));
inc.addQuery('incident_state','NOT IN','6,7');
inc.query();
while(inc.next())
{
arr.push(inc.getValue('number'));
}
if(arr.length>1){
gs.eventQueue("inactiveassigntoevent",grGroup,grGroup.manager.email,arr.join()); //here 4th parameter has comma separated incidents that are assigned to inactive users
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2018 08:21 AM
Hi abhi,
My apologies for responding Late. Your above code working like a charm.
Thanks
Shan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 04:23 AM
Hi could you please tell me what will be the BR when condition for this. I am using BR after on update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2021 04:22 AM
Hi... I have a similar query here: Notify Assignment Group to reassign tickets when assigned to user is inactive. Could you please help me. I am trying this on user table and event and notification is also on user table since BR is after update on sys_user. How it is done for group table.. What will be the BR when condition for using group table. Please visit my query and help me with that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2018 06:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2018 07:30 AM
Hi Abinay,
I want to send the same details to assignment group in CC..Please help me .
var grGroup = new GlideRecord('sys_user_group');
grGroup.addQuery("manager.active",true);
grGroup.addQuery("active",true);
grGroup.query();
while(grGroup.next()){
var arr=[];
var arr1=[];
var grps = '';
var inc= new GlideRecord("incident");
inc.addQuery('assigned_to.active',false);
inc.addQuery('assignment_group',grGroup.getValue('sys_id'));
inc.addQuery('incident_state','NOT IN','6,7');
inc.query();
while(inc.next())
{arr.push(grGroup.getValue('manager'));
//arr1.push(inc.getValue('number'));
var assign = inc.assigned_to.name;
arr1.push(assign + ' - ' +inc.getValue('number') + '</br>');
grps = inc.assignment_group.name;
//var group1 = inc.getValue('assignment_group');
}
if(arr1.length>1)
{
gs.eventQueue("inactiveassigntoevent",current,arr,arr1);
}
}