Skip to content

Commit 6ee5c2c

Browse files
Create Set Incident Priority to Critical.js
1 parent 768c37f commit 6ee5c2c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
function test() {
2+
// Check if incident is already Critical
3+
if (g_form.getValue('priority') == '1') {
4+
alert("This incident is already Critical. No changes were made.");
5+
return;
6+
}
7+
8+
// Show confirmation dialog
9+
var proceed = confirm("Are you sure you want to set this incident as Critical?");
10+
if (!proceed) return;
11+
12+
// Set fields on the form
13+
g_form.setValue('impact', 1); // High impact
14+
g_form.setValue('urgency', 1); // High urgency
15+
g_form.setValue('priority', 1); // Critical
16+
g_form.setValue('assigned_to', g_user.userID);
17+
18+
// Append note to description
19+
var currentDesc = g_form.getValue('description') || '';
20+
var note = "Priority set to Critical by " + g_user.getFullName() + " at " + new Date().toLocaleString();
21+
g_form.setValue('description', currentDesc + "\n" + note);
22+
23+
// Feedback message
24+
g_form.addInfoMessage("Incident marked as Critical. Remember to save or update the record.");
25+
}

0 commit comments

Comments
 (0)