diff --git a/Core ServiceNow APIs/GlideSystem/New Additional Message API/README.md b/Core ServiceNow APIs/GlideSystem/New Additional Message API/README.md new file mode 100644 index 0000000000..72a58a4ba2 --- /dev/null +++ b/Core ServiceNow APIs/GlideSystem/New Additional Message API/README.md @@ -0,0 +1,8 @@ +As part of the Zurich release, additional message methods were introduced to display at the top of forms. +addHighMessage() +addLowMessage() +addModerateMessage() +addSuccessMessage() + +image + diff --git a/Core ServiceNow APIs/GlideSystem/New Additional Message API/script.js b/Core ServiceNow APIs/GlideSystem/New Additional Message API/script.js new file mode 100644 index 0000000000..59a80750a7 --- /dev/null +++ b/Core ServiceNow APIs/GlideSystem/New Additional Message API/script.js @@ -0,0 +1,14 @@ +//Table: Incident +//When to Run: After update +(function executeRule(current, previous /*null when async*/ ) { + + if (current.priority == 2) + gs.addHighMessage("This is a high incident, and assign it as soon as possible."); + if (current.state == 6) + gs.addLowMessage("The incident will be marked as closed automatically after 7 days."); + if (current.state == 6) + gs.addModerateMessage("Refer to the resolution information section for the resolution notes."); + if (current.assigned_to.changes()) + gs.addSuccessMessage("The notification has been sent to the assignee."); + +})(current, previous);