Scheduled job not triggering email notification

Ryan Healey
Tera Expert

Hi Everyone,

I'm having an issue getting a notification to trigger off of a scheduled job and registered event.  Here's what I'm trying to accomplish and then I'll post the code.  

Business need:  We are working on a process for new hires and kicking off the Onboarding process via the Service Portal.  When the new user is added to the sys_user table, the manager listed on that record receives an email notification asking the manager to go to the Service Portal and request all the services needed to have the new employee hit the ground running on day 1.  In the event the manager does not enter the request in the SP, we need an email notification generated each day that the request is not submitted.  That's where I'm running into a roadblock.  

In my personal dev instance, I'm using a scheduled job that is going to run daily around 05:00 called onboard.remind.  Here is the script and I've also attached a screen shot.

var gr = new GlideRecord("sys_user");
gr.addEncodedQuery('u_os=Pending'); //On-boarding Status = Pending
gr.query();

while(gr.next()){
gs.eventQueue('onboard.reminder',gr);
}

For my test case, I have marked one user with the "Pending" onboarding status in his user record.  The combination of the scheduled job and the event seem to be pick up the correct user (second screen shot).  However, the notification is never triggered to the manager.  Any ideas on where I'm going wrong?  

Thanks in advance for the help!

1 ACCEPTED SOLUTION

Rajshekhar Pau1
Kilo Guru

Hi,

Please check if the Manager to whom you're sending is having an email id present on the user record, or if you're using Users/ Groups in field on the Notification, then check that the user for whom you're doing it is having a manager updated in his user record or not?

Hope this helps.

Mark helpful or correct based on impact.

Thanks.

View solution in original post

11 REPLIES 11

I just noticed that you said you were doing this in your personal developer instance.  Did you verify the user you have chosen has a manager.  There are a log on users in the PDI that do not have a manager set.

Brian Lancaster
Tera Sage

Can you send a screenshot of who will receive tab?