From 5136f367cf9163dd7ad08da303bcb55cfac03763 Mon Sep 17 00:00:00 2001 From: Rampriya <114834474+Rampriya-S@users.noreply.github.com> Date: Sat, 22 Oct 2022 21:41:18 -0400 Subject: [PATCH 1/3] Action to trigger the event from flow Just give the inputs for an action the Event name, Record, Parm1 and Parm2 to trigger the notification from the flow. --- Flow Actions/Action to create an event | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Flow Actions/Action to create an event diff --git a/Flow Actions/Action to create an event b/Flow Actions/Action to create an event new file mode 100644 index 0000000000..159f46cd53 --- /dev/null +++ b/Flow Actions/Action to create an event @@ -0,0 +1,4 @@ +(function execute(inputs, outputs) { +// ... code ... + gs.eventQueue(inputs.script_event,inputs.script_record,inputs.script_parm1,inputs.script_parm2); +})(inputs, outputs); From b3b00eb5b8deac2f2dd17e502beb6a476991ea46 Mon Sep 17 00:00:00 2001 From: Rampriya <114834474+Rampriya-S@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:48:32 -0400 Subject: [PATCH 2/3] Create Change Schedule Button on Change forms UI Action script that opens a modal dialog to update the Planning Start Date and Planning End Date on a Change Request form. The script opens a modal window, allowing the Change Admin to update the fields. Sharing use a UI Action with a simple UI Modal setup. --- Change Schedule Button on Change forms | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Change Schedule Button on Change forms diff --git a/Change Schedule Button on Change forms b/Change Schedule Button on Change forms new file mode 100644 index 0000000000..19ac9585ad --- /dev/null +++ b/Change Schedule Button on Change forms @@ -0,0 +1,57 @@ +//UI Action script that opens a modal dialog to update the Planning Start Date and Planning End Date on a Change Request form. The script opens a modal window, allowing the Change Admin to update the fields. Sharing use a UI Action with a simple UI Modal setup. +//UI Action condition gs.hasRole('change_admin') +function showModal() { + // Define modal properties + var dialog = new GlideModal('glide-modal-dialog'); + dialog.setTitle('Change Schedule'); + + // Add form to modal content + var modalContent = ` +
+
+ + +
+
+
+ + +
+
+ `; + dialog.setBody(modalContent, false, false); + + // Add Save and Cancel buttons + dialog.addFooterButton('Save', 'saveSchedule()', 'btn-primary'); + dialog.addFooterButton('Cancel', 'closeModal()', 'btn-default'); + + dialog.render(); +} + +function saveSchedule() { + var startDate = document.getElementById('start_date').value; + var endDate = document.getElementById('end_date').value; + + // Check if both dates are provided + if (!startDate || !endDate) { + alert('Please provide both Planning Start and End dates.'); + return; + } + + // Update the fields in the form + g_form.setValue('planned_start_date', startDate); + g_form.setValue('planned_end_date', endDate); + + // Optionally, save the form + g_form.save(); + + // Close the modal + closeModal(); +} + +function closeModal() { + GlideModal.close('glide-modal-dialog'); +} + +// Invoke the showModal function to display the modal +showModal(); From 1cac7a17818444335d56a1f71a97e5dfc110c94a Mon Sep 17 00:00:00 2001 From: Rampriya <114834474+Rampriya-S@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:13:30 -0400 Subject: [PATCH 3/3] Create Non-Operational & Installed Application CI Count Counts all application CIs where operational_status = 2 (non-operational) and install_status = 1 (installed). Outputs the total count to system logs for quick health and compliance checks. --- Non-Operational & Installed Application CI Count | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Non-Operational & Installed Application CI Count diff --git a/Non-Operational & Installed Application CI Count b/Non-Operational & Installed Application CI Count new file mode 100644 index 0000000000..8cf6404112 --- /dev/null +++ b/Non-Operational & Installed Application CI Count @@ -0,0 +1,12 @@ +var ga = new GlideAggregate('cmdb_ci_appl'); +ga.addQuery('operational_status', 2); // Non-operational +ga.addQuery('install_status', 1); // Installed +ga.addAggregate('COUNT'); +ga.query(); + +var total = 0; +if (ga.next()) { + total = ga.getAggregate('COUNT'); +} + +gs.info('Application CIs installed but not in operational count: ' + total);