Email notification will trigger after 30 days when incident closed how we can approach?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 10:03 PM
Email notification will trigger after 30 days when incident closed how we can approach?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 10:06 PM
You can create a schedule job which will run daily, it will find all the incidents closed 30 days ago, then you can fire an event for every incident. This event can be used to send notifications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 11:36 PM
Hi Deepak,
can u explain regarding script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2016 11:24 PM
Hi Srinivas,
There is an OOB closed_at field in the incident table . Set value to that field when incident is closed.
1.Create an event with name "incident.closed" .
2.Send notification when that event triggers.
3.Create a scheduled job that will trigger event daily basis.
Your script should be like below :
var qrystr = "closed_atBETWEENjavascript:gs.daysAgo(-29)@javascript:gs.daysAgo(-30)";
var expdt = new GlideRecord("incident");
expdt.addEncodedQuery(qrystr);
gs.log("Incident count " + expdt.getRowCount());
while(expdt.next())
{
gs.eventQueue("incident.closed", expdt, expdt.caller_id, expdt.caller_id.name);
}
Please mark it as Helpful/Correct if it helps
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2016 12:08 AM
Hi Sri,
Mihir has already provided the script, you can give it a try, it should work