Notification for inactive user

_bhishek
Tera Guru

Hi ,

I have a query ,How can i send notification to manager of 'assignment group'  of application  if 'owned by' user account  is inactivated under  application(cmdb_ci_appl) table.

Thanks .

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hello,

You need to a write a scheduled job that queries all the records from cmdb_ci_appl table where owned_by user is inactive and then trigger an event which sends the required notification to the manager of CI assignment group.

Sample script

var ci = new GlideRecord('cmdb_ci_appl');
ci.addEncodedQuery('owned_by.active=false');
ci.query();
while(ci.next()){
gs.eventQueue("replace_event_name_here", ci, ci.assignment_group.manager, ci.owned_by.name);
}

The first parameter for Event is sys_id of the assignment group manager and second parameter is the name of Owned by user.

In your email, select this event name as its source and also make sure you check the Event parm1 contains recipient check box in it so manager gets the notification.

Thanks!

 

View solution in original post

2 REPLIES 2

Alikutty A
Tera Sage

Hello,

You need to a write a scheduled job that queries all the records from cmdb_ci_appl table where owned_by user is inactive and then trigger an event which sends the required notification to the manager of CI assignment group.

Sample script

var ci = new GlideRecord('cmdb_ci_appl');
ci.addEncodedQuery('owned_by.active=false');
ci.query();
while(ci.next()){
gs.eventQueue("replace_event_name_here", ci, ci.assignment_group.manager, ci.owned_by.name);
}

The first parameter for Event is sys_id of the assignment group manager and second parameter is the name of Owned by user.

In your email, select this event name as its source and also make sure you check the Event parm1 contains recipient check box in it so manager gets the notification.

Thanks!

 

shloke04
Kilo Patron

Hi,

 

I don't think you can send Notification to a Email Address linked to an User Account which is Inactive i.e. Active Flag marked as True.

 

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke