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

Sebas Di Loreto
Kilo Sage
Kilo Sage

If your question is about how to put the sc_task.assigned to on the "who will receive" section, I can think two possible solutions:

1.- You create a separate notification triggered by an event for this case (specific RITM catalog item). That event should have the person you want to send the notification as parm1 and then you select "event parm1 contains recipient" (advanced view of the notification).

2.- You could create a business rule to copy the assigned to of the sc_task into the watchlist of the RITM and then use that field on your notification.

Hope this helps.


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


Hi Sebastian,

 

For #1, I have a separate notification with "Event parm 1 contains recipient" checked, but per your suggestion....how do you add the SCTASK's Assigned To as parm1?

Thanks,
AJ

Sebas Di Loreto
Kilo Sage
Kilo Sage

Ok, but what is on the "Send When" field for that separate notification that you have?

It should be "event is fired".

Then, the next question is what event name you selected?


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


Yes, Send When is "Even is Fired". Event name: sc_req_item.commented

- AJ

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.