- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 11:15 AM
I have two assignment rules set up that control the group assignment of certain incidents based on the conditions of business and non-business hours. Assignment rule A has conditions to assign the incident to Team A during business hours. Assignment rule B has conditions to assign the incident to Team B during non-business hours. I would take this a step further and incorporate our holiday schedule in ServiceNow into these assignment rules so if an incident comes in during business hours that is also a holiday, the incident is assigned to Team B rather than Team A. ServiceNow HI says this is not possible in OOB assignment rules. So I’m reaching out to the Community to see if anyone has come up with a solution for this. Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2020 03:00 AM
Hi,
Sorry for late answer.
I tried something as below with due date for testing. you can change it to creation date.
var date = new GlideDateTime(current.due_date);
var schedule = new GlideSchedule("08fcd0830a0a0b2600079f56b1adb9ae");
var flag = schedule.isInSchedule(date);
gs.log(flag,'ScheduleCheck');
if(flag == true){
current.assignment_group.setDisplayValue("Hardware");
}else{
var date = new GlideDateTime(current.due_date);
var schedule = new GlideSchedule("7b2af55ddbe814108844e1bb4b961953");
var flagNew = schedule.isInSchedule(date);
gs.log(flagNew ,'ScheduleCheck');
if(flagNew == true){
current.assignment_group.setDisplayValue("Software");
}
}
This are my schedule sys id and groups name please change those.
Thanks,
Ashutosh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 11:50 AM
Hi Chrish,
I think on-call scheduling will fit into this requirement, can you below link:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 12:18 PM
Hi,
We have to script in script field of the Assignment rule for this. Do you have a schedule created for this? like 8*5 weekdays and including holidays.
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 04:38 PM
Hi Ashutosh,
Yes, we have a schedule. Can you provide an example of the script you use for this? That would be very helpful.
Thanks,
Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-02-2020 03:00 AM
Hi,
Sorry for late answer.
I tried something as below with due date for testing. you can change it to creation date.
var date = new GlideDateTime(current.due_date);
var schedule = new GlideSchedule("08fcd0830a0a0b2600079f56b1adb9ae");
var flag = schedule.isInSchedule(date);
gs.log(flag,'ScheduleCheck');
if(flag == true){
current.assignment_group.setDisplayValue("Hardware");
}else{
var date = new GlideDateTime(current.due_date);
var schedule = new GlideSchedule("7b2af55ddbe814108844e1bb4b961953");
var flagNew = schedule.isInSchedule(date);
gs.log(flagNew ,'ScheduleCheck');
if(flagNew == true){
current.assignment_group.setDisplayValue("Software");
}
}
This are my schedule sys id and groups name please change those.
Thanks,
Ashutosh