Send Notification to SCTASK Assignment group When any comments added to RITM

Ravichandra2
Tera Contributor

HI All,

I Have a requirement to send a notification for Assignment Group of catalog task, When there is any update on Related RITM. Can Anyone Please help me on this.

 

Thanks,

Ravichandra G

6 REPLIES 6

Maddysunil
Kilo Sage

@Ravichandra2 

You can write After update business rule, and you can call eventQueue method to trigger notification:

below is the Business rule script:

 

(function executeRule(current, previous /*null when async*/) {
    // Check if the assignment group has been updated
    if (current.assignment_group != previous.assignment_group) {
        // Get the related catalog task
        var catalogTask = new GlideRecord('sc_task');
        catalogTask.addQuery('request_item', current.sys_id);
        catalogTask.query();
        if (catalogTask.next()) {
            // Send notification to the assignment group of the catalog task
            var assignmentGroup = catalogTask.assignment_group;
            gs.eventQueue('sc_task.assigned', catalogTask, assignmentGroup, 'notification');
        }
    }
})(current, previous);

 

Create this event sc_task.assigned in event registry then use it in notification.

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

xenot94628
Kilo Contributor

If you're looking for the best programming assignment help, look no further! This service offers top-quality assistance from experienced professionals who understand the complexities of coding. Whether you're stuck on a difficult problem or need help with a project, they provide reliable support that ensures you achieve great results. Highly recommended for all programming students!