- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 09:12 PM
Hello,
I have a requirement to send RITM SLA breach notification (75% and 90%) to associated catalog task's assignees.
Could anyone help on this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:04 PM - edited 07-14-2024 10:10 PM
HI @Annirnita Dash1 ,
Try something like below to pass the assigned to of sctask in the parm1:
Parameter 1 Script:
(function() {
var getTask = new GlideRecord('sc_req_item');
if (getTask.get(current.task)) {
var scTask = new GlideRecord('sc_task');
scTask.addQuery('request_item', current.task);
scTask.query();
while (scTask.next()) {
var assignee = scTask.assigned_to;
return assignee;
}
}
}());
In the notification, triggered by event. 'who will receive' will be as below:
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:07 PM
If this is a new SLA and new SLA workflow, I'd strongly suggest moving your logic to flow designer as workflow is now legacy and largely (some exceptions) not intended for new development.
Within the create event, you can run a glide record to set the parameter value of who will receive the notification
(function() {
//return current.task.assigned_to + "";
var scTaskGR = new GlideRecord('sc_task');
scTaskGR.addQuery('request_item' , current.getUniqueValue());
scTaskGR.addNotNullQuery('assigned_to')
scTaskGR.addActiveQuery();
scTaskGR.query();
var taskAssignedTo = [];
while(scTaskGR.next()){
taskAssignedTo.push(scTaskGR.getValue('assigned_to'));
}
return taskAssignedTo;
}());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 04:24 AM
In order to send notification to all users. You can use an array and push all the users in that as shown by Kieron Anson in the script provided below.
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 03:42 AM
Hello @SN_Learn again,
I would like to ask few more questions here.
I am some issue as the notification is sent to only either assignee or group in case of 1 catalog task being assigned and 1 being unassigned. Can you suggest anything here? It shall send to both (Asignee in case of assigned and Group in vase of unassigned)
Below is my script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 11:24 AM
Hi @Annirnita Dash1 ,
Please try with the below, tested and working in PDI
(function() {
var scTask = new GlideRecord('sc_task');
scTask.addQuery('request_item', current.getUniqueValue());
scTask.query();
var taskAssignedTo = [];
while (scTask.next()) {
if (scTask.assigned_to) {
taskAssignedTo.push(scTask.getValue('assigned_to'));
}
if(!scTask.assigned_to) {
taskAssignedTo.push(scTask.getValue('assignment_group'));
}
}
return taskAssignedTo;
}());
Couple of task under RITM, one is assigned to and another one is not assigned.
The email triggered to assignment group of the unassigned one and for the assigned to where it is assigned.
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 11:47 PM
hello @SN_Learn ,
Thanks for the reply, somehow this doesnot work for me. The notification itself is not sent, the Event is triggered though. will look more into it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2024 10:07 PM
If this is a new SLA and new SLA workflow, I'd strongly suggest moving your logic to flow designer as workflow is now legacy and largely (some exceptions) not intended for new development.
Within the create event, you can run a glide record to set the parameter value of who will receive the notification
(function() {
//return current.task.assigned_to + "";
var scTaskGR = new GlideRecord('sc_task');
scTaskGR.addQuery('request_item' , current.getUniqueValue());
scTaskGR.addNotNullQuery('assigned_to')
scTaskGR.addActiveQuery();
scTaskGR.query();
var taskAssignedTo = [];
while(scTaskGR.next()){
taskAssignedTo.push(scTaskGR.getValue('assigned_to'));
}
return taskAssignedTo;
}());