ServiceNow Snippets · LessonReviewed by Neelima, ServiceNow Architect · Updated · Published · current release · reference
ServiceNow Notification snippets
Trigger and shape email notifications.
Quick answer
Two notification snippets. To fire an event from a business rule, call gs.eventQueue with the event name, current, and two parameters such as priority and assigned_to, and let a notification listen for it. In a mail script inside the notification body, template.print writes computed text, for example the priority's display value, into the message.
Key takeaways
- Fire an event from a rule
- Mail script (in the notification body)
Notifications react to records or events.
Fire an event from a rule
gs.eventQueue('incident.escalated', current, current.priority, current.assigned_to);Mail script (in the notification body)
template.print('Priority: ' + current.priority.getDisplayValue());