when request is cancelled Send notification to Requester and assigned to members also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:44 AM
Hi All,
I have 2 different tables parent and child . If any one user click the cancelled button on the request notification has to send t0 both parent record and child records assigned to members. Please help me on this.
Thanks,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 06:19 AM
Hi Suresh,
You can do it with the help of a business rule and Event Queue method.
1. Create an event in event registry table.
2. Create a business rule on request table and put the condition when state changes to cancel and write the below script in advance section of your BR.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var childAssignedTo = [];
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('parent',current.sys_id); // or ritm.addQuery('request',current.sys_id);
ritm.query();
while(ritm.next()){
childAssignedTo.push(ritm.assigned_to);
}
gs.eventQueue('name of the event',current,current.assigned_to,childAssignedTo.toString());
})(current, previous);
3. Now you can create a notification on Request table, which will be triggered when the event is fired.
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2022 01:44 AM
Hi Mohit,
Sorry for the late reply,
In Parent table I have multiple child Task , If any one task state is close complete and another 2 task is in Open state . In parent table any one click on cancelled button notification has to send All SC task assigned to members (close complete state also). Please help me on this.
Thanks,
Suresh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 11:32 PM
Hi Suresh,
When you say child task does that mean catalog tasks or RITMs.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)