From 5f75d06ff74d6dad43a7cf503a2855e818a2a1a1 Mon Sep 17 00:00:00 2001 From: Thrizvi <145013431+Thrizvi@users.noreply.github.com> Date: Tue, 31 Oct 2023 00:43:17 +0530 Subject: [PATCH] Create UpdatePriorityBasedOnImpact.js we're update the priority of incidents based on their impact. --- Background Scripts/UpdatePriorityBasedOnImpact.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Background Scripts/UpdatePriorityBasedOnImpact.js diff --git a/Background Scripts/UpdatePriorityBasedOnImpact.js b/Background Scripts/UpdatePriorityBasedOnImpact.js new file mode 100644 index 0000000000..a69e719c7c --- /dev/null +++ b/Background Scripts/UpdatePriorityBasedOnImpact.js @@ -0,0 +1,15 @@ + +var gr = new GlideRecord('incident'); +gr.addQuery('active', true); +gr.addQuery('impact', '2'); +gr.query(); +while (gr.next()) { + + if (gr.impact == '2') { + gr.priority = '1'; + } else { + gr.priority = '2'; + } + gr.update(); +} +