Gowrisankar Sat
Tera Guru

Hi Chrish,

I think on-call scheduling will fit into this requirement, can you below link:

https://docs.servicenow.com/bundle/madrid-release-notes/page/release-notes/it-service-management/on-...

Ashutosh Munot1
Kilo Patron

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

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

 

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

View solution in original post

Ashutosh,

With just a little change to the code, I was able to use this and it works great.

I appreciate your assistance!

 

Chris