- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 11:26 AM
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
Solved! Go to Solution.
- Labels:
-
Task Communications Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2022 11:31 AM
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".
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 11:41 AM
Hi AJ27,
If I am understanding correctly can't you dot walk like this?
Mark Correct and Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 01:50 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 02:23 PM
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...
This is the script that achieves that.
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2022 03:01 PM
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