Notification not sent when customer adds comment to RITM – no email record created

ItayB
Tera Contributor

Hello Community!

I'm working on a requirement where a notification should be sent to the Assigned to user of an open Catalog Task (sc_task) whenever the Requested for user adds a comment in the Additional comments field on the parent Requested Item (sc_req_item).

 

This is my mission:

"Create a notification (content of the notification will be described below) that is sent to the proponent of an open task (Assigned to of the Catalog task) when the client (Requested for) writes a response in the Additional comments of the request.
Notes:
● If there is no proponent: the notification will be sent to the members of the proponent group (assignment group).
● If there is more than one open task: the notification will be sent to proponents of all open tasks."

 

I did Notification, Event, and Business Rule for this mission but when i go to "Email Logs" i dont see any email sent.

Picture of Event:

ItayB_0-1751794467775.png

 

Pictures of BR:

 

ItayB_1-1751794508495.png

 

 

ItayB_2-1751794534539.png

 

Pictures of Notification:

 

ItayB_3-1751794600819.png

 

ItayB_4-1751794616702.png

 

ItayB_5-1751794638655.png

 

 

In addition i add the system logs:

 

ItayB_6-1751794800762.png

 

 

Thank you All ! 

1 ACCEPTED SOLUTION

S Goutham
Tera Guru

Hi @ItayB 
1. I noticed the event you have registered is "sc_req_item.notification.itil" and the event called in the BR is "custom.client.comment.notification"
2. In your BR, please move the condition to check the additional comment change to when to run tab 

SGoutham_0-1751799450688.png


3. As you have the notification referring to sc_request_item, and you need to send the email to the task assignment group, which you will not be able to dot walk, so you need to send the group DL email address /sys_id in the event parameter of the BR refer to the script shown below

	if (current.sys_updated_by == current.requested_for.user_name) { //check if the latest comment added is by requested for
	    var taskgrp = [];
	    var taskGr = new GlideRecord('sc_task');
	    taskGr.addQuery('request_item', current.sys_id);
	    taskGr.addQuery('state', 'NOT IN', '3,4,7');
	    taskGr.query();
	    while (taskGr.next()) {
	        taskgrp.push(taskGr.assignment_group.email.toString()); //pushing all the active assignment group email id's
	    }
	    //syntax gs.eventQueue ('<event name registered'>,' <gliderecord of the notification table>','event param 1<optional>','event param 2 <optional>');
	    gs.eventQueue('sc_req_item.notification.itil', current, taskgrp);
	}

Hope you have verified if the task group records have email id's, if not push the group sys_id's

taskgrp.push(taskGr.assignment_group.sys_id.toString());

Do the above changes and try to trigger the email and check them in the email logs




  



I hope this solves your issue
Mark this as Helpful / Accept the Solution if this clears your issue

View solution in original post

13 REPLIES 13

Mohammad Danis1
Giga Guru

@ItayB ,
As Gautam pointed out event name is also different 🙂
Please correct it.
Event you have registered is "sc_req_item.notification.itil" and the event called in the BR is "custom.client.comment.notification".

Regards,
Mohammad Danish

ItayB
Tera Contributor

I tried all of what you told me.. still nothing.. 

ChatGPT told me that for this mission the table should be sc_task and not the sc_req_item.. 
Its true?

Mohammad Danis1
Giga Guru

Hi @ItayB ,

No, the table where the BR should trigger should be Request Item only.
Can you check the email logs now?
 Also, share the updated BR and Notification screenshot.
Regards,
Mohammad Danish

Mohammad Danis1
Giga Guru

@ItayB ,

1. Please add a condition in BR "Additional Comment " -> Changes.

2. We don't need this on insert. Please run this on Update only.

MohammadDanis1_0-1751805761006.png

------------------------------------ | Was my response helpful? | ------------------------------------
⬇️Dropping a Kudos or Accepting as solution ↘️ would be absolutely brill Cheers!



Regards,
Mohammad Danish