IT CanvassTalk to an advisor
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());
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support