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

Yousaf
Giga Sage

Hi AJ27,
If I am understanding correctly can't you dot walk like this?

Yousaf_0-1667241645835.png

 

Mark Correct and Helpful if it helps.


***Mark Correct or Helpful if it helps.***

Hi Yousef,

 

Parent.Assign To or Parent.anything of the RITM doesn't refer to the SCTASK of said RITM. It refers to the parent record of the said RITM record.

Thanks,
AJ

Sebas Di Loreto
Kilo Sage
Kilo Sage

You answer resides on using a "notification email script" (type that on the left nav).

Here is a simple out of the box example, just add it at the end of your instance: /sys_script_email.do?sys_id=db0d2dc3972011005aa4390ddd2975c7

A little bit more complex: /sys_script_email.do?sys_id=df0d2dc3972011005aa4390ddd2975c7

 

I ran into the same scenario when sending a change request notification to the requester saying it was REJECTED. 

We wanted to include the comments entered by the person rejecting it, which are in the individual approval record related to the change. This is similar to your example, my approval record is your sc_task AND my change is your RITM.

Create the "notification email script" with everything you want to display and call it in your notification content like this...

SebastianDL_0-1667250682913.png

 

This is the script that achieves that.

SebastianDL_1-1667251376125.png

 


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


Thanks Sebastian. I'm not sure if your suggestion works because I'm at the "Scripting for Dummies" stage and have no idea how to modify your example. However, what you've provided makes since given the similarity in scenarios.

 

- AJ