We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 599f55e commit 5596b2bCopy full SHA for 5596b2b
Server-Side Components/Scheduled Jobs/Auto-Reassign Stale Incidents to Group Manager/script.js
@@ -0,0 +1,17 @@
1
+var grInc = new GlideRecord('incident');
2
+grInc.addQuery('state', 2); // 2 = In Progress
3
+grInc.addQuery('sys_updated_on', '<=', gs.daysAgoStart(7));
4
+grInc.query();
5
+
6
+while (grInc.next()) {
7
+if (!grInc.assignment_group)
8
+ continue;
9
10
+// Find the group manager
11
+var group = new GlideRecord('sys_user_group');
12
+if (group.get(grInc.assignment_group) && group.manager) {
13
+grInc.assigned_to = group.manager;
14
+grInc.work_notes = 'System: Reassigned to group manager : "+group.manager+"due to inactivity (15+ days).';
15
+grInc.update();
16
+}
17
0 commit comments