How to auto-assign an incident ticket to an specific support group after normal working hours?

feibian
Kilo Contributor

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

1 ACCEPTED SOLUTION

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");


}


View solution in original post

16 REPLIES 16

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");


}


don't forget to set the group names in the "<>"


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>");


}


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");


}  


and does it work?