- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 02:40 AM
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:
Pictures of BR:
Pictures of Notification:
In addition i add the system logs:
Thank you All !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 04:02 AM
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
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
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 03:39 AM
No, I don't want you to remove it but I want you to pass the recipient from BR instead of passing comments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 03:45 AM
I dont understand what you mean bro..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 03:51 AM
Hi @ItayB,
-------------------------------------------------------------------------------------------------
You're almost there — just a small adjustment needed in your configuration.
In your Business Rule, you're using:
In BR you mentioned-:
gs.eventQueue('event.name', GlideRecord, parm1, parm2);
From what I see in your Notification record, you've checked the box indicating that Param 1 contains the recipient. However, in your script, Param 1 is set to current.comments... and Param 2 holds the record's sys_id.
To properly send the notification to the intended user, either Param 1 or Param 2 should contain the recipient's email address (depending on which checkbox is selected in the Notification setup).
So in your case, make sure:
Param 1 has the email address if you're using "Param 1 contains recipient", or
Param 2 has the email address if you're using "Param 2 contains recipient".
Update the script or the Notification configuration accordingly, and it should work as expected!
---------------------------------------------------------------------------------------------------------------------
If this helps, please mark it as Helpful and Accept as Solution. Let me know if you need further guidance!
Thanks & Regards
Mayank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 03:53 AM
Hi @ItayB ,
Please update your BR script at line number 16 as below:
gs.eventQueue("custom.client.comment.notifiction", taskGr, taskGr.assigned_to,current.comments.getJournalEntry(1));
Regards,
Mohammad Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2025 04:02 AM
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
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
Mark this as Helpful / Accept the Solution if this clears your issue