RITM Notification to Send to Assigned To from SCTASK

TStark
Kilo Sage

I have a notification on the sc_req_item table that when triggered needs to be sent the Assigned To from the SCTASK. I can't figure out how to achieve this for one specific notification and not all notifications.

Thanks,
AJ

1 ACCEPTED SOLUTION

Cool. That event is generated by this out of the box business rule: /sys_script.do?sys_id=9790a7400a00070450a5ccf2d15a89c3

Check the first line. Events a lot simpler than what you think.

That first line with fire the event FOR the current ritm WITH Parm1 being the sys_id of the logged user (most likely entering the comment), AND Parm 2 being the actual name of the logged user.

The sys_id is the unique identifier that the notification will be able to use to send it to.

Parm2 can be used on the content to say "Dear $Parm2".

 

SebastianDL_0-1667412383156.png

 

This is the part you have to think how to achieve your particular situation since you don't want to modify this out of the box business rule. It is being used on all RITMs.

Maybe you create another simple business rule that fires your OWN event in the script section passing the assigned_to of the sc_task.

 

var scTask = new GlideRecord('sc_task');
scTask.addEncodedQuery('request_item='+current.sys_id);
scTask.query();
if(scTask.next());
    gs.eventQueue("sc_req_item.commented.sc_task.assigned_to", current, scTask.assigned_to, scTask.assigned_to.name);   

 

Remember you need to create the "sc_req_item.commented.sc_task.assigned_to" event in system policy/registry: /nav_to.do?uri=%2Fsysevent_register_list.do

Just click NEW, select the Requested Item table and add the event name.

You can use the "sc_req_item.commented" as guidance: /nav_to.do?uri=sysevent_register.do?sys_id=1e0608bd0a0a3c74018096fc93d76513


If I helped you with your case, please click the Thumb Icon and mark as Correct.


View solution in original post

10 REPLIES 10

Heeeey it worked! I had to play around with it to get it right. I included screenshots below for visuals. Thanks Sebastian! 

 

AJ27_0-1667585360152.png

=======

AJ27_1-1667585513582.png

=======

AJ27_2-1667585784429.png