From 24b87b60c167b9806e5376db212d7b02e56d605f Mon Sep 17 00:00:00 2001
From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com>
Date: Sat, 4 Oct 2025 11:35:36 +0530
Subject: [PATCH 01/15] Create UIaction.js
---
.../Resolve Incident UI Page/UIaction.js | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js
diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js b/Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js
new file mode 100644
index 0000000000..75e25468f0
--- /dev/null
+++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js
@@ -0,0 +1,18 @@
+function ResolveIncident() {
+ var dialog = new GlideModal("resolve_incident");
+ dialog.setTitle("Resolve Incident");
+ dialog.setPreference('sysparm_record_id', g_form.getUniqueValue());
+ dialog.render(); //Open the dialog
+}
+
+
+// Navigate to System UI > UI Actions.
+// Create a new UI Action with the following details:
+// Name: Resolve Incident (or a descriptive name of your choice).
+// Table: Incident [incident].
+// Action name: resolve_incident_action (must be a unique, server-safe name).
+// Order: A number that determines the position of the button on the form.
+// Client: Check this box. This is crucial for running client-side JavaScript.
+// Form button: Check this box to display it on the form.
+// Onclick: ResolveIncident() (This must match the function name).
+// Condition: Set a condition to control when the button is visible (e.g., current.active == true).
From ed72117191d5715ca9075e35654ea79c8b6f8240 Mon Sep 17 00:00:00 2001
From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com>
Date: Sat, 4 Oct 2025 11:37:26 +0530
Subject: [PATCH 02/15] Create resolve_incident_uipage.html
---
.../resolve_incident_uipage.html | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100644 Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html
diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html b/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html
new file mode 100644
index 0000000000..29777dbc8d
--- /dev/null
+++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
- +
From f3711c57ff872929f9a1fe24e276b9bebbf071c8 Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 11:53:54 +0530 Subject: [PATCH 07/15] Update README.md --- .../UI Pages/Resolve Incident UI Page/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md b/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md index f5b3b75b5a..92606f09bf 100644 --- a/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md +++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md @@ -19,7 +19,7 @@ Copy the provided script into the Script field. Click Submit. ///////////////////////////////////////////////// -Navigate to system defintion > UI pages +Navigate to system definition > UI pages Fill the HTML and client script Submit From 9baf436adba690453e343c61607834e60bac118c Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 12:48:25 +0530 Subject: [PATCH 08/15] Update README.md added more description of use case and how it works --- .../Resolve Incident UI Page/README.md | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md b/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md index 92606f09bf..d602d54f83 100644 --- a/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md +++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/README.md @@ -1,3 +1,19 @@ +Use Case: + +Everytime user try to resolve the incident, the resolution codes and resolution notes are mandatory to be entered as it hidden in tabs,Since it is mandatory fields. So to ease the process we introduced a custom UI action will prompt the user +to enter resolution notes and resolution codes and automatically set the state to Resolved. + +How it Works: + +Navigate the Incident form and make sure the incident is not closed or active is false. +Click Resolve Incident UI action, it will open an modal with asking resolution notes and resolution code. +Provide the details and submit. incident is updated with above Resolution notes and codes and set state to be Resolved. + + +Below Action Need to Performed: + +1.Create UI action: + Navigate to System UI > UI Actions. Create a new UI Action with the following details: Name: Resolve Incident (or a descriptive name of your choice). @@ -9,7 +25,8 @@ Form button: Check this box to display it on the form. Onclick: ResolveIncident() (This must match the function name). Condition: Set a condition to control when the button is visible (e.g., current.active == true). -///////////////////////////////////////////////// +2.Create Script Include: + Navigate to System Definition > Script Includes. Click New. Fill in the form: @@ -18,13 +35,10 @@ Client callable: Check the box. Copy the provided script into the Script field. Click Submit. -///////////////////////////////////////////////// -Navigate to system definition > UI pages -Fill the HTML and client script -Submit +3.Create UI page: + +Navigate to System Definition > UI pages +Fill the HTML and client script. +Click Submit. -//Verification -Navigate the Incident form and make sure the incident is not closed or active is false -Click Resolve Incident UI action, it will open an modal with asking resolution notes and resolution code. -Provide the details and submit. incident is updated with above details and set to resolved. From b0e779d57dc085becafc5db7e01229130d127eaf Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:31:24 +0530 Subject: [PATCH 09/15] Update and rename resolve_incident_client.js to ui_page_client.js --- .../{resolve_incident_client.js => ui_page_client.js} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename Client-Side Components/UI Pages/Resolve Incident UI Page/{resolve_incident_client.js => ui_page_client.js} (85%) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_client.js b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js similarity index 85% rename from Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_client.js rename to Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js index 7fdc392412..4d18dfc7a6 100644 --- a/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_client.js +++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js @@ -1,4 +1,6 @@ - function ResolveIncident(sysId) { +// Below code will be used in client script of UI page as mentioned in README.md file + +function ResolveIncident(sysId) { var rejectionReason = document.getElementById('resolution_reason').value; var resolutionCode = document.getElementById('resolution_code').value; var ga = new GlideAjax('ResolutionProcessor'); From 1d8db78bcb045c962e9a21f599b361286d6fd195 Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:31:51 +0530 Subject: [PATCH 10/15] Rename UIaction.js to UI_action.js --- .../Resolve Incident UI Page/{UIaction.js => UI_action.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Client-Side Components/UI Pages/Resolve Incident UI Page/{UIaction.js => UI_action.js} (100%) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js b/Client-Side Components/UI Pages/Resolve Incident UI Page/UI_action.js similarity index 100% rename from Client-Side Components/UI Pages/Resolve Incident UI Page/UIaction.js rename to Client-Side Components/UI Pages/Resolve Incident UI Page/UI_action.js From 61a3a21811cfed9170c8b151cd7e570d09adb562 Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:32:40 +0530 Subject: [PATCH 11/15] Rename resolve_incident_uipage.html to ui_page_html.html --- .../{resolve_incident_uipage.html => ui_page_html.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Client-Side Components/UI Pages/Resolve Incident UI Page/{resolve_incident_uipage.html => ui_page_html.html} (100%) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html similarity index 100% rename from Client-Side Components/UI Pages/Resolve Incident UI Page/resolve_incident_uipage.html rename to Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html From 8e0782083051ae65903003b73238ffd0a1b04a61 Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:53:36 +0530 Subject: [PATCH 12/15] Update ui_page_client.js --- .../UI Pages/Resolve Incident UI Page/ui_page_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js index 4d18dfc7a6..9888645a39 100644 --- a/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js +++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js @@ -1,6 +1,6 @@ // Below code will be used in client script of UI page as mentioned in README.md file -function ResolveIncident(sysId) { +function ResolveIncidentOnsubmit(sysId) { //This function is called in UI page HTML section When user clicks the Submit button var rejectionReason = document.getElementById('resolution_reason').value; var resolutionCode = document.getElementById('resolution_code').value; var ga = new GlideAjax('ResolutionProcessor'); From 294766257168a694d4ea6aa562e0c5abfb61f4a5 Mon Sep 17 00:00:00 2001 From: Naveen Kumar <103413520+naveensnow@users.noreply.github.com> Date: Sat, 4 Oct 2025 13:54:17 +0530 Subject: [PATCH 13/15] Update ui_page_html.html updated the function name --- .../UI Pages/Resolve Incident UI Page/ui_page_html.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html index 58cb7911e0..185cf04a43 100644 --- a/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html +++ b/Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_html.html @@ -21,6 +21,6 @@
-