From 2fec8dc5623195e64cd112408e3e0e20c0db1546 Mon Sep 17 00:00:00 2001 From: Indra-kolge <123245160+Indra-kolge@users.noreply.github.com> Date: Fri, 17 Oct 2025 21:22:55 +0530 Subject: [PATCH 1/2] CloseAllChildCases.js --- .../CloseAllChildCases/CloseAllChildCases.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Client-Side Components/UI Actions/CloseAllChildCases/CloseAllChildCases.js diff --git a/Client-Side Components/UI Actions/CloseAllChildCases/CloseAllChildCases.js b/Client-Side Components/UI Actions/CloseAllChildCases/CloseAllChildCases.js new file mode 100644 index 0000000000..50e8a34515 --- /dev/null +++ b/Client-Side Components/UI Actions/CloseAllChildCases/CloseAllChildCases.js @@ -0,0 +1,15 @@ +var gr = new GlideRecord('sn_customerservice_case'); +gr.addQuery('parent', current.sys_id); +gr.query(); +var counter = 0; +while (gr.next()) { + if (gr.state != 3) { + gr.resolution_code = '16'; + gr.close_notes = 'This case was auto closed from the parent case.'; + gr.state = '3'; + gr.update(); + counter++; + } +} +gs.addInfoMessage(counter + ' cases have been closed.'); +action.setRedirectURL(current); From b3b51a02b730f245f68587b47bbc21b7ff3d7df8 Mon Sep 17 00:00:00 2001 From: Indra-kolge <123245160+Indra-kolge@users.noreply.github.com> Date: Fri, 17 Oct 2025 21:25:17 +0530 Subject: [PATCH 2/2] README.md --- .../UI Actions/CloseAllChildCases/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Client-Side Components/UI Actions/CloseAllChildCases/README.md diff --git a/Client-Side Components/UI Actions/CloseAllChildCases/README.md b/Client-Side Components/UI Actions/CloseAllChildCases/README.md new file mode 100644 index 0000000000..acebd5e82d --- /dev/null +++ b/Client-Side Components/UI Actions/CloseAllChildCases/README.md @@ -0,0 +1,6 @@ +Name: Close all Child Case +Table:sn_customerservice_case +Condition: (gs.hasRole('sn_customerservice_agent') || gs.hasRole('admin') ) + +Use Case: +Provide UI action button to close all the associated child cases from the parent Case.