Inbound actions route assignemnt group with Schedule

athavichith
Kilo Sage

I want to have a inbound action route to specific assignment group for business hours. Our business hours is between 6:30 AM to 5:00 PM EST.  How can I achieve that? 

 

These are sys_id of the assignment group:

 

    var afterHoursGroup = '0f32deb09773995030aab2a3f153af35';
    var serviceDeskGroup = '4b329e3c97fb9550cc467d021153afd1';
2 REPLIES 2

athavichith
Kilo Sage

Can someone validate my script, I tested it out, seems to be working. Not sure about the currentMinutes conditions though. 

 

 var afterHoursGroup = '0f32deb09773995030aab2a3f153af35';
    var serviceDeskGroup = '4b329e3c97fb9550cc467d021153afd1';

    var gt = new GlideTime();
    var gdt = new GlideDateTime();
    var gdtLocal = gdt.getLocalTime();
    var currentHour = gdtLocal.getHourLocalTime();
    var currentMinutes = gdtLocal.getMinutesLocalTime();

    if ((currentHour >= 6 && currentMinutes > 30) && currentHour < 17) {
        current.assignment_group = serviceDeskGroup;
    } else {
        current.assignment_group = afterHoursGroup;
    }

Hello @athavichith 

 

Tried in my system and currently we are at 00:13 AM 

 

Shivalika_0-1742928235388.png

 

Its giving correct result per that. 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY