- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2017 10:53 AM
Hi Everyone
I would like to know if Is there a way I can route to an specific group of high/critical tickets that are received outside of normal working hours?
Scenario:
7 am to 7 pm tickets should be routed to "AAA support group"
7 pm to 7 am and weekends high/critical tickets should be routed to "BBB support group"
Your help on this will be appreciated
Fabian GR
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:57 AM
Neither of those will work, for two different reasons.
Use the below, EXACTLY as is:
var g = new GlideRecord('cmn_schedule');
g.addQuery('name', 'Normal working hours');
g.query();
if (g.next()) {
var sched = new GlideSchedule(g.sys_id);
var d = new GlideDateTime();
if (sched.isInSchedule(d))
current.assignment_group.setDisplayValue("C360 Ops Triage");
else
current.assignment_group.setDisplayValue("PEGA-Coverage Review");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:23 AM
My bad, the script needed some finishing touches, try this:
var g = new GlideRecord('cmn_schedule');
g.addQuery('name', 'Normal working hours');
g.query();
if (g.next()) {
var sched = new GlideSchedule(g.sys_id);
var d = new GlideDateTime();
if (sched.isInSchedule(d)) {
// normal hours
current.assignment_group.setDisplayValue("<name of assignment group for in hours>");
} else {
// out of hours
current.assignment_group.setDisplayValue("<name of assignment group for out of hours");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:25 AM
don't forget to set the group names in the "<>"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:53 AM
I have modified the code however the issue still persist
var g = new GlideRecord('cmn_schedule');
g.addQuery('name', 'Normal working hours');
g.query();
if (g.next()) {
var sched = new GlideSchedule(g.sys_id);
var d = new GlideDateTime();
gs.info(d);
if (sched.isInSchedule(d))
current.assignment_group.setDisplayValue("<C360 Ops Triage>");
else
current.assignment_group.setDisplayValue("<PEGA-Coverage Review>");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:29 AM
This is the script that I added
var g = new GlideRecord('cmn_schedule');
g.addQuery('name', 'Normal working hours');
g.query();
if (g.next()) {
var sched = new GlideSchedule(g.sys_id);
var d = new GlideDateTime();
gs.info(d);
if (sched.isInSchedule(d))
gs.info("Is in the schedule");
current.assignment_group.setDisplayValue("C360 Ops Triage");
else
gs.info("Is NOT in the schedule");
current.assignment_group.setDisplayValue("PEGA-Coverage Review");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2017 07:48 AM
and does it work?