Automated Email from Incidents( P1 and P2) based on Distribution Lists recored on the Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We have a requirement to record a Distrubution List on P1 and P2 Incidents and would need to understand what is the best way to implement this.
Automated emails need to be sent to the Distrubution list from ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @ratnasekhar
Automated emails for P1/P2 incidents can be sent by creating an event in a Business Rule (triggered by insert/update) which then triggers a Notification.
For distribution lists, use gs.eventQueue to pass the email addresses or a group ID to the notification, rather than hardcoding in the Business Rule.
Create an Event Registry Entry:
- Navigate to System Policy > Events > Registry.
- Click New.
- Name: incident.p1p2.email
- Table: incident
Create the Business Rule:
- Name: Send P1/P2 Email to Distribution List
- Table: Incident [incident]
- When: after (Update)
- Conditions: Priority | is one of | 1 - Critical, 2 - High
(function executeRule(current, previous /*null when async*/) {
var distributionList = 'p1p2_support@company.com'; // Replace with your actual Distribution List Email
gs.eventQueue('incident.p1p2.email', current, distributionList, null);
})(current, previous);
Create the Notification:
- Navigate to System Notification > Email > Notifications.
- Click New.
- Name: P1/P2 Incident Notification
- Table: Incident [incident]
- When to send: Event is incident.p1p2.email
- Who will receive: Under "Event parm1 contains recipient", check the box.
- What it will contain: Define subject and body.
refer post : Trigger P1 and P2 Notifications to Assignment Group for Incidents
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you @Tanushree Maiti please see my revised requirements .
Requirement 1
Ability to record a Distribution List against a CI, potentially through a custom field within ServiceNow, so Service Owners can maintain the relevant notification group.
Requirement 2
Automatic email notification to the recorded Distribution List (or potentially an Assignment Group in ServiceNow terminology) whenever:
- a new Incident is created as P1/P2, or
- an existing Incident is upgraded to P1/P2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ratnasekhar
For requirement 1, do you want to send notification to specific DL when a specific CI Class's CI having a custom attribute and that is updated. Just trying to understand the trigger condition.
For requirement 2 - Probable solution is already given.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes to the DL of the CI captured in the incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @ratnasekhar
For requirement 1, You can do it in several ways.
Option1 :
- Navigate to System Policy > Events > Registry.
- Click New.
- Event Name: incident.ci.changed (update it as you wish).
- Table: Incident [incident].
- Click Save.
Create a Business Rule
- Navigate to System Definition > Business Rules.
- Click New.
- Name: Fire Event on CI Change.
- Table: Incident [incident].
- Check Advanced.
- When: after.
- Check Insert and Update.
- Filter Conditions: Configuration item | Changes OR Configuration item | Is not empty.
- Under the Advanced tab, add the following script:
(function executeRule(current, previous /*null when async*/) {
// Pass the CI display value in Parm1 and Incident Number in Parm2
gs.eventQueue('incident.ci.changed', current, current.cmdb_ci.getDisplayValue(), current.number);
})(current, previous);
- Click Submit.
Create the Notification
- Navigate to System Notification > Email > Notifications.
- Click New.
- Name: Notify DL on Incident CI Change.
- Table: Incident [incident].
- When to send:
- Send when: Event is fired.
- Event name: incident.ci.changed.
- Who will receive:
- Users/Groups: Add your specific group or users.
- Email addresses: Add your Distribution List email address here (e.g., itsupport@example.com).
- What it will contain:
- Subject: CI Updated for ${event.parm2}: ${current.short_description}
- Message HTML:
<p>The Configuration Item for incident ${event.parm2} has been created or updated.</p>
<p><strong>New/Updated CI:</strong> ${event.parm1}</p>
<p><strong>Incident Description:</strong> ${short_description}</p>
<p><a href="${URI_REF}">Click here to view incident</a></p>
- Click Save.
Option2: If users to subscribe/unsubscribe to CIs. OOB configuration is there.
Refer: KB0694157 How CI subscription notifications work
Option3: You can do the same using flow designer FLOW
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti