diff --git a/Client-Side Components/UI Actions/Generate PDF/README.md b/Client-Side Components/UI Actions/Generate PDF/README.md new file mode 100644 index 0000000000..ca87f9f4b6 --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/README.md @@ -0,0 +1,6 @@ +Description: +This UI Action enables users to generate and download the current record in PDF format. It is particularly useful in the Incident table for PIR (Post-Incident Review) documents after resolution. + +Pre-requisite: +A dedicated form view must be created containing all relevant fields such as Resolution Code, Resolution Notes, Assignment Group, Assigned To, and others required for comprehensive reporting. +In this code, I've used the view name called 'pdf_export' which is already created in the Incident table diff --git a/Client-Side Components/UI Actions/Generate PDF/Script.js b/Client-Side Components/UI Actions/Generate PDF/Script.js new file mode 100644 index 0000000000..5c21ad5786 --- /dev/null +++ b/Client-Side Components/UI Actions/Generate PDF/Script.js @@ -0,0 +1,10 @@ +// UI Action: Generate PDF +// Table: Incident +// Condition: current.state=='6' //Resolved +// Onclick: generatePDF(); +// sysparm_view = pdf_export +function generatePDF() { + + var url = '/'+g_form.getTableName() + '.do?sys_id=' + g_form.getUniqueValue() + '&PDF&sysparm_view=pdf_export'; + top.window.open(url, '_blank'); +} diff --git a/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/README.md b/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/README.md new file mode 100644 index 0000000000..7fa02ec5c2 --- /dev/null +++ b/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/README.md @@ -0,0 +1,2 @@ +Description: +This background script is used to automatically update the content of all published Knowledge Base articles by replacing outdated group references, ensuring consistency and relevance across documentation without the need to manually check out and edit each article diff --git a/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/script.js b/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/script.js new file mode 100644 index 0000000000..3dce667c12 --- /dev/null +++ b/Server-Side Components/Background Scripts/Bulk Update of Fulfillment Group References in Published KB Articles/script.js @@ -0,0 +1,14 @@ +var old_reference = "Service desk"; // Old group name +var new_reference = "Help desk"; // New group name + +var regexPattern = new RegExp('(?is)'+ old_reference, 'gi'); // Building Regex to generate case-insensitive pattern + +var kb_article = new GlideRecord('kb_knowledge'); +kb_article.addEncodedQuery('workflow_state=published'); +kb_article.query(); +while(kb_article.next()){ + kb_article.text = kb_article.text.replace(regexPattern,new_reference); // Replacing the old group reference with the new group + kb_article.setWorkflow(false); + kb_article.update(); + gs.info('Updated Article: ' + kb_article.number); +}