- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:34 AM
Hi,
I have to create a notification on the CI table. On that CI table, I have a field named Warranty Expiration. If the warranty is going to expire in the next 30 days, I want it to notify me.
I have created a condition in the builder but unable to receive a notification.
My notification is as follows:
Condition is : Warranty Expiration is less than 30 Days before Warranty Expiration
Who will Receive column : I have assigned it to me.
Is this condition right or should I change that? Please let me know.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:42 AM
Hi Prudhvi,
It cannot be achieved in this way directly.
Create a Schedule Job(Script execution) place in the code to Glide in the table and fetch the record with the condition.
Now for each record trigger the event.
Define that event in registry.
Use this event in Notification when to send tab.
Eg ---
Schedule job script -- Run daily
var gr = new GlideRecord("cmdb_ci");
gr.addEncodedQuery("warranty_expirationRELATIVEGT@dayofweek@ahead@30");
gr.query();
while(gr.next()){
gs.eventQueue("event_name",gr,"","");
}
Hope this helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:41 AM
Hi Prudhvi,
Create an event and trigger that event from scheduled job and then configure the notification from that event.
Your scheduled job should run on daily basis.
Thanks,
Maddy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:47 AM
Hi madanm7786,
Could you please guide me in achieving this as I am quite new to Servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:42 AM
Hi Prudhvi,
It cannot be achieved in this way directly.
Create a Schedule Job(Script execution) place in the code to Glide in the table and fetch the record with the condition.
Now for each record trigger the event.
Define that event in registry.
Use this event in Notification when to send tab.
Eg ---
Schedule job script -- Run daily
var gr = new GlideRecord("cmdb_ci");
gr.addEncodedQuery("warranty_expirationRELATIVEGT@dayofweek@ahead@30");
gr.query();
while(gr.next()){
gs.eventQueue("event_name",gr,"","");
}
Hope this helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2017 03:47 AM
Hi Prudhvi,
If recipients are static (just yourself for example), then you can use Scheduled reports for this.
http://wiki.servicenow.com/index.php?title=Scheduling_and_Publishing_Reports#gsc.tab=0
Create a report that filters CIs with Warranty Expiration before 30 days from now.
Schedule it to run daily / weekly.
Also handy to tick the checkbox "Omit if empty" this way you'll receive the email only if there's at least 1 CI in the report.
Cheers!