setting notification email to fire 90 days before expiry date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 12:42 AM
Hi All,
I am trying to create an event that will fire a notification to a company 90 days before the expiry of their license. I am new to SNOW and have hit a road block with the scheduled job any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 12:47 AM
HI RObert
Are you doing this in workflow, then you can use the timer activity and send the notification using that.See the below thread that can help you out.
Is it possible to create a notification 7 days before 'Due Date' on a workflow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 12:51 AM
I was told to do a scheduled job as the date field that needs to be queried is on over 200 CI's and it needs to run on a daily basis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 12:50 AM
you can also write a scheduled job that will run daily and check each record on the table where expiry date is. IN servicenow you can you glidedatetime function to get the date before 90 days.
See the script in the below thread that will give you some idea how to create the script.
Re: Sending notification X days prior to a variable date in a task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2017 01:04 AM
You can check below script.
var lic = new GlideRecord('cmdb_ci'); // put you cmdb table
lic.addQuery('u_date_of_expiry',gs.daysAgo(-5)); // wit this condition add other condtion for which record you want to check the licnese
lic.query();
while (lic.next()) {
gs.eventQueue("YOUR_EVENT_NAME",lic,PARAM1,PARAM2); // YOU CAN PASS THE EMAIL ID LIST IN PARAM1 TO WHOM EMAIL NEED TO SEND
}