File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Client-Side Components/UI Actions/Set Incident Priority Critical Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments