Allocation Expiry Notification
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2024 05:47 AM
Hi all,
we have a scheduled job to fire a notification which the scheduled job is run's daily and to trigger a notification we have a script include where OOB functionality is notification triggers to end date which is 30 days prior to today. but here we need to some customizations to trigger notification within 30days and here schedule job will run weekly basis so no repeated Notifications.
scheduled job:
this is the function where i added Operator to trigger notification within 30days to end date.
getExpiringAllocationsNotificationDetails: function() {
var allocationsGoingToExpire = [];
var daysToBeConsideredForNotifying = WSMConstants.ALLOCATION_EXPIRY_DAYS;
var dateToBeNotifiedFor = new GlideDate();
dateToBeNotifiedFor.addDaysUTC(daysToBeConsideredForNotifying);
var allocationGr = new GlideRecord(WSMConstants.TABLES.CC_DEPT);
allocationGr.addActiveQuery();
allocationGr.addQuery('end_date', '<=', dateToBeNotifiedFor);
//allocationGr.addEncodedQuery('active=true^end_dateRELATIVELT@dayofweek@ahead@30');
allocationGr.query();
while (allocationGr.next()) {
var recipients = this.getRecipients(allocationGr);
allocationsGoingToExpire.push({
'allocationId': allocationGr.getValue('sys_id'),
'recipients': recipients
});
}
var recipientsToAllocationMap = this.getAllocationAssociatedWithRecipients(allocationsGoingToExpire);
return recipientsToAllocationMap;
},
any suggestion to get notification triggers within 30days
0 REPLIES 0