- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 03:47 AM
Hi All ,
I have a requirement for notification , pls help to complete this .
I need to notification to "assigned to " and If assigned to is empty then send a notification to assignment group manager.
Thanks in advance !!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 03:55 AM
The best way to trigger the notification here is
1) create an event - lets just say you created the event as "email.send"
2) write a business rule
Once your record has been created/updated
Please trigger the event and write the script as below
if(current.assigned_to){
gs.eventQueue('email.send', current, current.assigned_to);
}
else{
var gr = new GlideRecord("sys_user_group");
gr.get(current.assignment_group)
var managerEmail = gr.manager;
gs.eventQueue('email.send', current, managerEmail );
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 03:54 AM
Hello @Akanksha Gupta2
var unassignTask = new GlideRecord('sn_ind_tmt_orm_order_task');
unassignTask.addActiveQuery('assigned_toISEMPTY');
unassignTask.addQuery('assigned_to', '');
unassignTask.query();
while(unassignTask.next()){
gs.eventQueue('sn_srm_assigned_empty_notify', unassignTask, unassignTask.assignment_group, null);
}
plz refer the above script and do changes accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 03:29 AM
Can you explain me more
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 03:55 AM
The best way to trigger the notification here is
1) create an event - lets just say you created the event as "email.send"
2) write a business rule
Once your record has been created/updated
Please trigger the event and write the script as below
if(current.assigned_to){
gs.eventQueue('email.send', current, current.assigned_to);
}
else{
var gr = new GlideRecord("sys_user_group");
gr.get(current.assignment_group)
var managerEmail = gr.manager;
gs.eventQueue('email.send', current, managerEmail );
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.