Creating Schedule job to send notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2019 12:15 PM
Hi,
I have to create a scheduled job which will run daily to send a notification to the caller of the incident, if the ticket is in active state for more than 5 days.
Below is the script I have written in the Schedule job-
var gr = new GlideRecord('incident');
gr.addQuery('state', 'Active');
gr.addQuery('sys_created_on', '<', gs.daysAgo(5));
gr.query();
while(gr.query()){
gs.eventQueue('Incident.Active',gr, '','');
}
I have registered an event called Incident.Active and created a notification. I have not added any condition/script in the notification.This is not working though. Can someone please explain me my mistake?
I am very new to Servicenow and any help is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2021 05:50 PM
Hello All,
I was going through the post and it seems to be very helpful, I am also trying to create a kind of a notification which triggers every year on a list of cloud applications business owners . I created a scheduled jobs and an event and a notification, however when the execute a scheduled job the firing of the event or the notification is not happening. Any leads to this. this is what I have used as a steps:
var gr = new GlideRecord('u_cloud_applications');
gr.addEncodedQuery('u_business_ownerISNOTEMPTY');
gr.query();
while(gr.next()){
gs.eventQueue('Cloud Application Notification',gr);
}
cloud application notification is the Event.
Regards
Nilanjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2021 04:22 AM
Hi Nilanjan,
Event Registry name should not contain space.
like : Cloud Application Notification
it must be as like : Cloud.Application.Notification
that's why event not getting fired
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2023 11:27 PM
InsteadOf two addQuery methods,Can You use encodedQuery or use and condition to make it as a single Query