From b7dc2dad4925aecb334a3756f4f1fbf223b3aa1d Mon Sep 17 00:00:00 2001 From: Shrikant Kulkarni <49854331+shridk@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:02:02 +0530 Subject: [PATCH 1/2] Create script.js This UI Action script sets current incident record as priority as Critical. --- UI Actions/Set Incident Priority Critical/script.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 UI Actions/Set Incident Priority Critical/script.js diff --git a/UI Actions/Set Incident Priority Critical/script.js b/UI Actions/Set Incident Priority Critical/script.js new file mode 100644 index 0000000000..83ff7b773d --- /dev/null +++ b/UI Actions/Set Incident Priority Critical/script.js @@ -0,0 +1,9 @@ +// Call this function from OnClick field of UI Action form +function ClientSideScript() { + var answer = confirm("Are you sure you want to set priority as Critical?"); + if (answer == true) { + g_form.setValue('assigned_to', g_user.userID); + g_form.setValue('impact', 1); + g_form.setValue('urgency', 1); + g_form.setValue('description', g_form.getValue('description') + "\nPriority is set to Critical by " + g_user.getFullName()); + } From 91e7c4d58fff17669a9a192727164cafd0047f82 Mon Sep 17 00:00:00 2001 From: Shrikant Kulkarni <49854331+shridk@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:06:37 +0530 Subject: [PATCH 2/2] Create readme.md Readme file --- .../Set Incident Priority Critical/readme.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 UI Actions/Set Incident Priority Critical/readme.md diff --git a/UI Actions/Set Incident Priority Critical/readme.md b/UI Actions/Set Incident Priority Critical/readme.md new file mode 100644 index 0000000000..337a804558 --- /dev/null +++ b/UI Actions/Set Incident Priority Critical/readme.md @@ -0,0 +1,19 @@ +Set Incident Priority Critical + +This UI Action sets current incident record as priority as Critical. + +When clicked +Below Conformation message will be displayed to the user as below +"Are you sure you want to set priority as Critical?" + +If user selects cancel nothing will happen. + +If user selects confirm then +a) It sets the Priority of the current Record as 1-Critical by setting Urgency and Impact as 1-High. +b) It also sets 'assigned_to' field as 'logedin user'. +c) It also upends the description as "Priority is set to Critical by 'logedin User'". + +** Please note that it changes field values only on the form that is client side. +Unless you submit or update the record, field values will not be updated in the database table records. + +You can use this as reference to set other field values as well.