How can I notify the assignee of an SCTASK when a requestor updates the RITM?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 05:38 AM
Hello all,
I'm stuck on this one and can't get it to work. Any advice on how to configure a notification so the "Assigned to" of an SCTASK gets notified when a requestor updates the RITM?
Thanks!
Mike
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 05:42 AM
There are a couple of ways you could approach this. One would be to create an after update business rule on the RITM table that triggers when a comment is added, fetches all of the open tasks associated to the RITM and triggers an event for each task. Then you'd setup a notification for that event.
Another way is to setup a business rule that copies the comment from the RITM down to the catalog task. This would then trigger the OOB catalog task was updated notification assuming that's still active in your instance.
Let me know if you need assistance with the scripting for either of these approaches. I'm happy to help with that as well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 05:49 AM
Hi Michael,
I'm going to assume there can be multiple SCTASKs available to any RITM - AND that they may be assigned to multiple people, - AND that you only want to notify those who have active SCTASKs (ignore the people who have already completed their task.
You would do this with an AFTER business rule on the RITM table. Trigger a event to send a notification to each task owner.
NOTE - this is not tested
Name: notify active task assignees
Table: Requested item (sc_req_item)
Active: true
Insert: true
Update: true
Advanced; true
When: After
Condition: current.comments.changes() <<== Change this to the condition you want to trigger the notifications
Script:
(function executeRule(current, previous /*null when async*/) {
var task = new GlideRecord('sc_task');
task.addQuery('request_item', current.sys_id);
task.addActiveQuery();
task.query();
while (task.next()) {
gs.eventQueue('sc_task.ritm.comments', task, task.getValue('assigned_to'), '');
}
})(current, previous);
Go to System Policy> Events> Registry and create a registry entry for 'sc_task.ritm.comments'
Create a notification that reacts to that event (you'll need to click the Advanced view link). For the recipient, check the box that says "Event Parm 1 contains recipient' (

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2020 12:49 PM
Thanks for this, worked great. What changes would be needed to avoid sending multiple emails to someone who owns multiple active tasks for this RITM?