- 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 02:31 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 02:24 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 07:50 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2022 08:27 AM
Yes, Send When is "Even is Fired". Event name: sc_req_item.commented
- AJ
- 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.