How to create email notification for REQ,RITM, INC, SCTASK, TASK

Vijay Kumar4
Mega Guru

When a REQ,RITM, INC, SCTASK, TASK is assigned to Security_Team, any status change should trigger email, and the status should be included in the subject line of the email. How can I create a single notification for all these when the status is changed any of these

Note: This should be applicable only when the ticket is with Security_Team.

24 REPLIES 24

Ohoo @Vijay Kumar4 

 

Mine is indeed on task_sla table. You can change your table to task SLA then it will work 🙂 as its working for me and for all the tables it will work. 

 

CC: @Ankur Bawiskar 

@Shivalika 

I believe your notification is on task_sla table and hence ${task.state} will work

but @Vijay Kumar4 has notification on task table itself

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

swapnali ombale
Kilo Sage

hi @Vijay Kumar4 ,

 

To create a single notification for REQ, RITM, incident, SCTASK, and task updates in ServiceNow, you can utilize a notification on the relevant tables. 

1. Create the Notification:
  • Navigate to System Notification > Notificationsand create a new notification.
  • Configure the notification details:
    • Name: A descriptive name for the notification.
    • Send to: The email address or user group to receive the notification.
    • Subject: The subject of the email.
    • Message: The content of the email.
    • Data pills: Use data pills to include relevant information from the record (e.g., record number, comments, etc.).
  • Save the notification . 

 

swapnaliombale_0-1743622601287.png

 

swapnaliombale_1-1743623078582.png

 

 

swapnaliombale_3-1743623536556.png

OR

 

To create a single notification for REQ, RITM, incident, SCTASK, and task updates in ServiceNow, you can utilize an event and a notification, triggered by a business rule on the relevant tables. 
 
Here's a breakdown of the process:
 
1. Define the Event:
  • Navigate to System Policy > Events > Registryand create a new event.
  • Give it a name(e.g., "my_company.update.notification").
  • Set the Table fieldto the table where you want to trigger the notification (e.g., sc_req_item for RITM, incident for incident, task for task, etc.). 
     
 
2. Create the Business Rule:
  • Navigate to System Business Rulesand create a new business rule.
  • Select the tablewhere you want to trigger the event (e.g., sc_req_item, incident, task, etc.).
  • Choose the trigger(e.g., "After insert", "After update") based on when the notification should fire.
  • Write the scriptto trigger the event when a specific condition is met (e.g., when a comment is added, or a status changes).

// Example for RITM table
if (current.isInsert() || current.update_comments != null) {
new GlideRecord('sys_event').insert(new Event('my_company.update.notification', current.sys_id));
}

  • Replace my_company.update.notification with your event name. 
     
  • Replace current.sys_id with the appropriate record ID for the table. 
     
 
3. Create the Notification:
  • Navigate to System Notification > Notificationsand create a new notification.
  • Set the Event fieldto the event you created (e.g., "my_company.update.notification").
  • Configure the notification details:
    • Name: A descriptive name for the notification.
    • Send to: The email address or user group to receive the notification.
    • Subject: The subject of the email.
    • Message: The content of the email.
    • Data pills: Use data pills to include relevant information from the record (e.g., record number, comments, etc.).
  • Save the notification .

Kindly mark my answer as helpful and accept solution if it helped you in anyway. 

@swapnali ombale 

Thank you for your detailed response. I have configured the email notification as you suggested, but during testing, the email is only sent when the state changes in the TASK record and does not trigger for REQ, RITM, SCTASK, or INC.

VijayKumar4_1-1743674589996.png

 

VijayKumar4_0-1743674568956.png

 

Additionally, in the second method, while creating the event, there is only one table option available to select, which is also not working as expected.

Ankur Bawiskar
Tera Patron
Tera Patron

@Vijay Kumar4 

I will recommend to have separate notifications for each table considering in future what if the email subject and body changes

At that time developer will have to separate those anyways.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader