Skip to content

Commit e247993

Browse files
authored
Refactor message handling based on incident priority
1 parent 6d657cb commit e247993

File tree

1 file changed

+10
-4
lines changed
  • Core ServiceNow APIs/GlideSystem/New Additional Message API

1 file changed

+10
-4
lines changed
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
//Table: Incident
2+
//When to Run: After update
13
(function executeRule(current, previous /*null when async*/ ) {
24

3-
gs.addHighMessage("This is high priority");
4-
gs.addLowMessage("This is low priority");
5-
gs.addModerateMessage("This is moderate priority");
6-
gs.addSuccessMessage("This is a success message");
5+
if (current.priority == 2)
6+
gs.addHighMessage("This is a high incident, and assign it as soon as possible.");
7+
if (current.state == 6)
8+
gs.addLowMessage("The incident will be marked as closed automatically after 7 days.");
9+
if (current.state == 6)
10+
gs.addModerateMessage("Refer to the resolution information section for the resolution notes.");
11+
if (current.assigned_to.changes())
12+
gs.addSuccessMessage("The notification has been sent to the assignee.");
713

814
})(current, previous);

0 commit comments

Comments
 (0)