- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2015 03:55 AM
Hello,
I'm experiencing an issue with a notification not sent to the task assignment group when a service catalog task is commented.
The Additional Comments section on the Catalog Task, is on sc_task.request_item.comments
When I define the condition for "when to send", I don't see Additional comments in the list under Requested item fields.
I try to trigger the event with "Event is fired" instead of Insert/Update and defined a business rule on the requested item table, but it doesn't send the notification as well.
These are screenshots of the business rule, event registry and notification:
Notification:
Event registry:
Business rule:
If someone can help me with this issue will be great.
Thanks a lot in advance!
Maria
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2015 12:19 PM
In the script where you trigger the event sc_req_item.commented you can add the following code:
var grpList = [];
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request_item',current.sys_id);
tsk.addQuery('active','true');
tsk.query();
while (tsk.next()){
grpList.push(tsk.assignment_group+'');
}
gs.eventQueue("sc_req_item.commented",current, grpList.join(','),gs.getUserName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2015 11:55 AM
Hi Terri,
I set a notification in the RITM table:
A notification is sent to the person who opened the request and John Mack, but the assignment group doesn't receive it, as it is in the sc_task table.
Where do I need to set a script with parameter the assignment group? And what does the script should look like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2015 12:19 PM
In the script where you trigger the event sc_req_item.commented you can add the following code:
var grpList = [];
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request_item',current.sys_id);
tsk.addQuery('active','true');
tsk.query();
while (tsk.next()){
grpList.push(tsk.assignment_group+'');
}
gs.eventQueue("sc_req_item.commented",current, grpList.join(','),gs.getUserName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2015 12:14 AM
BIG BIG THANK YOU Terri
The script works and the notification is sent to the assignment group
I'm posting some screenshots for the users who will read this thread in the future:
1. The notification is in the sc_req_item table and is triggered by an event:
2. The event is run in the sc_req_item table and is fired by a Business rule
3. The Business rule includes the script for getting the task assignment group:
4. In the notification pass the event parameter:
And it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 07:52 AM
This article was awesome. Help me with my problem. We have the same thing with the comments not sending notification to the assigned_to. In the code I change the assighment group to assigned to. IT WORKED. But now the request.requested_for or opened by is not receiving notification. What do I need to change.
here is my entire code on the BR
if (current.operation() == 'insert') {
gs.eventQueue("sc_req_item.inserted", current, gs.getUserID(), gs.getUserName());
}
if (current.operation() == 'update') {
gs.eventQueue("sc_req_item.updated", current, gs.getUserID(), gs.getUserName());
}
if (current.operation() == 'update' && current.stage == "delivery") {
gs.eventQueue("sc_req_item.delivery", current, gs.getUserID(), gs.getUserName());
}
if (current.operation() != 'insert' && current.comments.changes()) {
var assigneeArr = [];
var assignGroupArr = [];
//Query for any non-pending, associated tasks
var catTsk = new GlideRecord('sc_task');
catTsk.addQuery('request_item', current.sys_id);
//catTsk.addQuery('state', '!=', -5);
catTsk.query();
if(!catTsk.hasNext()){
gs.addInfoMessage('This comment has been added but may not be viewed by technicians until work begins on the request item.');
}
while(catTsk.next()){
//If we find tasks then get the assignees and notify them
if(!catTsk.assigned_to.nil()){
assigneeArr.push(catTsk.assigned_to.toString());
}
else{
assignGroupArr.push(catTsk.assignment_group.toString());
}
//Add ITIL watch list users
assigneeArr.push(catTsk.u_itil_watch_list.toString());
                //Add Group watch list users
assigneeArr.push(catTsk.group_list.toString());
  }
//Notify the assignees
gs.eventQueue("sc_req_item.commented.itil", current, assigneeArr, assignGroupArr);
//Notify the end-user
gs.eventQueue("sc_req_item.commented", current, gs.getUserID(), gs.getUserName());
}
if (!current.assigned_to.nil() && current.assigned_to.changes()) {
gs.eventQueue("sc_req_item.assigned", current, current.assigned_to.getDisplayValue() , previous.assigned_to.getDisplayValue());
}
if (current.stage.changes()) {
gs.eventQueue("sc_req_item.change.stage", current, current.stage, previous.stage);
}
//DP - 04/19/17 added to test commment from RITM to TASK and to assignment group
var grpList = [];
var tsk = new GlideRecord('sc_task');
tsk.addQuery('request_item',current.sys_id);
tsk.addQuery('active','true');
tsk.query();
while (tsk.next()){
grpList.push(tsk.assigned_to+'');
}
gs.eventQueue("sc_req_item.commented",current, grpList.join(','),gs.getUserName());
screen shot of the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2017 08:22 AM
I think I got it to working now. I checked the box "Send to Event creator". Now the assignee is getting the email and the requested for.