- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2024 05:38 AM
Hello,
We have a requirement to trigger the email notification daily to the Multiple Group members having approvals in "Requested" state. This email should be triggered to each member separately with the link of the approvals to be actioned on.
It would be helpful if you suggest any solution
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
1. A system property is created to store the sys_ids of the assignment groups.
2. An event is defined in the Event Registry, which will be triggered by a scheduled job.
3. A schedule item is created in the "sys_trigger" table to run daily.
The following script is used to send notifications to members of assignment groups who have approvals in the "Requested" state.
var abc = gs.getProperty('systempropertycreated');
var grApproval = new GlideRecord('sysapproval_approver');
grApproval.addEncodedQuery('state=requested^source_table=TableName^group.assignment_group.sys_idIN' + abc);
grApproval.query();
var userMap = {};
while (grApproval.next()) {
var userSysID = grApproval.approver.toString();
if (!userMap[userSysID]) {
userMap[userSysID] = true;
gs.eventQueue('EventName', grApproval, grApproval.approver.email, grApproval.approver.getDisplayValue());
}
}
4. Created the notification containing links of records pending with approvals and associated it with the event created earlier by selecting the event name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2024 05:46 AM
something like this as reminder flow which runs daily
check these videos, enhance it as per your requirement
- https://www.youtube.com/watch?v=hVctTUMWIcs
- https://www.youtube.com/watch?v=zsY0JyVBPz4
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
1. A system property is created to store the sys_ids of the assignment groups.
2. An event is defined in the Event Registry, which will be triggered by a scheduled job.
3. A schedule item is created in the "sys_trigger" table to run daily.
The following script is used to send notifications to members of assignment groups who have approvals in the "Requested" state.
var abc = gs.getProperty('systempropertycreated');
var grApproval = new GlideRecord('sysapproval_approver');
grApproval.addEncodedQuery('state=requested^source_table=TableName^group.assignment_group.sys_idIN' + abc);
grApproval.query();
var userMap = {};
while (grApproval.next()) {
var userSysID = grApproval.approver.toString();
if (!userMap[userSysID]) {
userMap[userSysID] = true;
gs.eventQueue('EventName', grApproval, grApproval.approver.email, grApproval.approver.getDisplayValue());
}
}
4. Created the notification containing links of records pending with approvals and associated it with the event created earlier by selecting the event name.