From 14a630c5db26d47a5e39b13edca32852221725f5 Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 23:56:19 +0530 Subject: [PATCH 1/2] Create Readme.md --- .../Catalog Client Script/Auto Assign incident/Readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 Client-Side Components/Catalog Client Script/Auto Assign incident/Readme.md diff --git a/Client-Side Components/Catalog Client Script/Auto Assign incident/Readme.md b/Client-Side Components/Catalog Client Script/Auto Assign incident/Readme.md new file mode 100644 index 0000000000..aa876b708a --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Auto Assign incident/Readme.md @@ -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. From 2168ae7ec7bf3f5833498313222d9b457133e409 Mon Sep 17 00:00:00 2001 From: Maheshkh9738 Date: Wed, 29 Oct 2025 23:58:02 +0530 Subject: [PATCH 2/2] Create Script.JS --- .../Auto Assign incident/Script.JS | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Client-Side Components/Catalog Client Script/Auto Assign incident/Script.JS diff --git a/Client-Side Components/Catalog Client Script/Auto Assign incident/Script.JS b/Client-Side Components/Catalog Client Script/Auto Assign incident/Script.JS new file mode 100644 index 0000000000..1ce92beecc --- /dev/null +++ b/Client-Side Components/Catalog Client Script/Auto Assign incident/Script.JS @@ -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 + } +})();