Configuring Reminder Notifications on Recurring Reservations

jlynch23
Tera Expert

We have a use case where we would like to set up a reminder notification (email preferably) that would be sent out to the requester when a Recurring Reservation is approaching the end of the time span.  This would then prompt them to either let our Housing team know that it is no longer needed, or request an extension of the reservation.

 

The issue I'm running into is how to trigger that notification.  My initial thought was to have a scheduled job that checks the existing Parent reservations for the end date within the week, and alerts the relevant team and people.  There is not a field on the Parent Reservation that contains this end date - there is the "Recurring pattern payload" field that stores the start date and the pattern followed to make the reservations as a series of name-value pairs, but no end date is consistently shown there.

 

How would you go about making these reminder emails?  I have found a part of the WSDReservationUtilsSNC that appear to be able to find the parent reservation to close/complete it once the final child reservation is ended.

1 REPLY 1

Prinssi
Mega Sage

Hi @jlynch23 ,

 

All occurrence reservations have the parent reservation listed under the "Source reservation" field.

 

With that in mind, you could write a GlideRecord query to retrieve all of the active parent reservations.

 

Then, for each of those records, write another GlideRecord query to get all of the child reservations using the sys_id of the parent for Source reservation. Use orderByDesc on the occurrence reservation start time so that the latest reservation is the first result. 

 

Using if (gliderecord.next()) logic, you could check to see if the latest reservation start time is within your specified timeframe. If it is within the timeframe, trigger the notification, and if not, do nothing and proceed to the next parent reservation.