- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 07:59 AM
Afterhours during the week and on weekends, we have a ticket type that would need to be redirected to the NOC instead of the regular assignment group.
I setup a schedule, but I am not sure what the next step should be. Advice?
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 08:29 AM
Hi Julia,
Have you viewed the below post and answer from Ashutosh Munot.
To help others, please mark correct and/or helpful.
Thanks,
Robbie
https://community.servicenow.com/community?id=community_question&sys_id=294bd9b81be49010a59033f2cd4bcb2f
The script should you be unable to access it using due date for testing. This could easily be changed to creation date for example.
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 schedule sys id's and group names are for example only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-28-2022 08:29 AM
Hi Julia,
Have you viewed the below post and answer from Ashutosh Munot.
To help others, please mark correct and/or helpful.
Thanks,
Robbie
https://community.servicenow.com/community?id=community_question&sys_id=294bd9b81be49010a59033f2cd4bcb2f
The script should you be unable to access it using due date for testing. This could easily be changed to creation date for example.
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 schedule sys id's and group names are for example only.