Incident is oh-hold and reason is 'awaiting caller' means notification will be send
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:46 AM
In incident form when state is 'On-Hold' and reason is 'Awaiting Caller' for 5 days means, Notification will be triggered to assigned to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:48 AM
Hi, is it a question? If so, you can create an email notification for incident table where mentioned requirements are met.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:58 AM
I created notification, but I need a script (business rule) for this question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 08:31 AM
Create a scheduled event as part of the business rule:
var gdt = gs.nowDateTime();
var gdt1 = new GlideDateTime(gdt);
var days = parseInt(5);
var hours = days * parseInt(8); //considering 8 business hours per day
var dur = new GlideDuration(60 * 60 * 1000 * hours);
var schedule = new GlideSchedule("c00bf1a22b80d500ea7d4c9405da1592"); //Schedule to use
var notifyDate = schedule.add(gdt1, dur);
gs.eventQueueScheduled("event_name", current, parm1, parm2, notifyDate);
Make sure to delete this event in case the state or on hold reason changes, script would be somewhat:
var gr = new GlideRecord('sysevent');
gr.addQuery('state', 'ready');
gr.addQuery('name', 'event_name');
gr.addQuery('table', 'incident');
gr.addQuery('instance', current.sys_id + '');
gr.query();
if (gr.next()) {
gr.deleteRecord();
}
Thank you!
Regards,
Rana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2022 12:18 AM
Hi, consider to use a flow instead, something like: