Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This project automatically assigns incidents to different support groups based on the time of day. For example, incidents created during day shift are assigned to the Day Support Group, while those created during night shift go to the Night Support Group. This ensures timely handling and reduces manual routing.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(function executeRule(current, previous /*null when async*/) {
var now = new GlideDateTime();

var daySchedule = new GlideSchedule('46d3f0b1dbf01300a6a5f0b1dbf01300'); // Day Schedule
var nightSchedule = new GlideSchedule('56e4f0b1dbf01300a6a5f0b1dbf01300'); // Night Schedule

if (daySchedule.isInSchedule(now)) {
current.assignment_group = '76f5f0b1dbf01300a6a5f0b1dbf01300'; // Day Support Group
} else if (nightSchedule.isInSchedule(now)) {
current.assignment_group = '86g6f0b1dbf01300a6a5f0b1dbf01300'; // Night Support Group
} else {
current.assignment_group = 'f2c9980bf9bc3a10f9182b07f0f0832a'; // Optional fallback
}
})();
Loading