Copy Comments from Requested Item (RITM) to All Active Catalog Tasks (sc_tasks)

ServiceNow Business rule to copy RITM comments to all active child catalog tasks. This is useful for when the requestor adds a comment to the RITM, and we need to communicate that comment to the sc_task fulfillers.

Business Rule
Table: Requested Item [sc_req_item]
Advanced
Before Update
Condition: Additional comments changes

(function executeRule(current, previous /*null when async*/) {

    updateTasks();

    function updateTasks() {
        var sctask = new GlideRecord('sc_task');
        sctask.addQuery('request_item', current.sys_id);
        sctask.addQuery('active', true);
        sctask.query();
        while (sctask.next()) {
            sctask.work_notes = 'Additional Comment added to Request: ' + current.comments;
            sctask.update();
        }
    }
})(current, previous);


Leave a comment

Latest Posts