Notifications for Additional Comments Added After Closure

TStark
Kilo Sage

Can anyone provide any insight on how to create a notification that will trigger when Addition Comments are added for a both active and inactive RITM? I have not problems with notifications in general. The part I'm having an issue with is to trigger this notification when the RITM is closed. I've tried the obvious conditions "Active is true or Active is false" but no luck. Just to outline my need:

 

- The table I'm using is Request Item [sc_req_item]

- When to Send: Event is fired, I've also tried Record inserted or updated with Updated checked.
- Event name: sc_req_item.commented
- Conditions: I've tried, 1. "Active is true or Active is false", 2. Additional Comments changes, 3. No conditions
- This notification is for the Assigned To to receive the notification when the the requestor adds comments.

Thanks in advance,

AJ

5 REPLIES 5

Sure. Here's a screenshot of the call from the notification to the business rule and a copy/paste of the business rule being called.

 

AJ27_0-1667165006625.png

 

gs.eventQueue("sc_req_item.commented", current, gs.getUserID(), gs.getUserName());
queueAssigneeEvent();

function queueAssigneeEvent() {
var assigneeArr = [];
var assignGroupArr = [];
//Query for non-pending sc_task records
var catTsk = new GlideRecord('sc_task');
catTsk.addQuery('request_item', current.sys_id);
catTsk.addQuery('state', '!=', -5);
catTsk.query();
if (!catTsk.hasNext()) {
gs.addInfoMessage(gs.getMessage('Comment cannot be viewed by technicians until work begins on the Requested Item'));
return;
}
while (catTsk.next()) {
//notify task assignees
if (!catTsk.assigned_to.nil())
assigneeArr.push(catTsk.assigned_to.toString());
else
assignGroupArr.push(catTsk.assignment_group.toString());
//Add Work notes watch list users
assigneeArr.push(catTsk.work_notes_list.toString());
}
gs.eventQueue("sc_req_item.commented.itil", current, assigneeArr, assignGroupArr);
}

 

Thanks,
AJ