diff --git a/Business Rules/Decision Table API/README.md b/Business Rules/Decision Table API/README.md new file mode 100644 index 0000000000..cdedb4fc25 --- /dev/null +++ b/Business Rules/Decision Table API/README.md @@ -0,0 +1,3 @@ +Integrate Decision tables via business rules to update CSF pillar and CSF Domain on Risk Record based on CSF Capability. +If the business have any multiple permutations and combinations for OOB fields CSF Capability, CSF Domain, CSF Pillar- +Before, Insert/Update BR and specify your conditions based on update diff --git a/Business Rules/Decision Table API/decisionTable.js b/Business Rules/Decision Table API/decisionTable.js new file mode 100644 index 0000000000..251ec44f4b --- /dev/null +++ b/Business Rules/Decision Table API/decisionTable.js @@ -0,0 +1,11 @@ +var sysID = 'custom_sys_id'; + var dt = new sn_dt.DecisionTableAPI(); //Calling Decision Table API + var inputs = new Object(); + inputs['u_csf'] = current.u_csf_capability; //Map to Decision Table Question Inputs + var response = dt.getDecision(sysID, inputs); + if (response != null) { + var csfDomain = response.result_elements.u_csf_domain; + var csfPillar = response.result_elements.u_csf_pillar; + current.u_csf_domain = csfDomain; + current.u_csf_pillar = csfPillar; //works well for multiple permutations and combinations on Risk Record + } diff --git a/GlideSystem/Dynamic Email Notification/README.md b/GlideSystem/Dynamic Email Notification/README.md new file mode 100644 index 0000000000..c7da61705f --- /dev/null +++ b/GlideSystem/Dynamic Email Notification/README.md @@ -0,0 +1,2 @@ +USE CASE: send a custom email directly from a script. +Triggers a scheduled email event dynamically using eventQueueScheduled() diff --git a/GlideSystem/Dynamic Email Notification/dynamicEmail.js b/GlideSystem/Dynamic Email Notification/dynamicEmail.js new file mode 100644 index 0000000000..86b33d0817 --- /dev/null +++ b/GlideSystem/Dynamic Email Notification/dynamicEmail.js @@ -0,0 +1,5 @@ +(function() { +var subject = 'Incident Update'; +var body = 'Hello, this is an automated update for your incident.'; +gs.eventQueueScheduled('custom.email.event', current, subject, body, new GlideDateTime().addSeconds(10)); +})();