Need to update Change Events change.calendar.notify so that calendar invite happens AFTER approval
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2023 06:07 AM - edited ‎07-18-2023 06:11 AM
Hey everyone! We have a notification that gets triggered by an event that sends a calendar invite on peoples outlook emails. There's two different things I've tried doing here. Here is the original Business Rule that is triggering the event to trigger the notification (the portion that pertains to us)
if (current.start_date.changes() || current.end_date.changes() || current.assigned_to.changes() || current.u_change_implementer.changes()) {
if(!current.start_date.nil() && !current.end_date.nil()){
if(current.assigned_to == current.u_change_implementer){
gs.eventQueue("change.calendar.notify", current, current.assigned_to, previous.assigned_to);
} else {
if (!current.assigned_to.nil()) {
gs.eventQueue("change.calendar.notify", current, current.assigned_to, previous.assigned_to);
}
//adding notifications for change implemeneter
if (!current.u_change_implementer.nil()) {
gs.eventQueue("change.calendar.notify", current, current.u_change_implementer, previous.u_change_implementer);
}
}
}
// Remove from previous assigned to, due to assigned_to changing
if (!previous.assigned_to.nil()) {
if (!current.assigned_to.nil() && current.assigned_to.changes() &&
(!previous.start_date.nil() && !previous.end_date.nil())) {
gs.eventQueue("change.calendar.notify.remove", current, current.assigned_to, previous.assigned_to);
}
} else if (!current.assigned_to.nil()) {
if ((current.start_date.changes() && !previous.start_date.nil()) ||
(current.end_date.changes() && !previous.end_date.nil())) {
gs.eventQueue("change.calendar.notify.remove", current, current.assigned_to, current.assigned_to);
}
}
//Remove from previous implemeneter due to implemementer changing
if (!previous.u_change_implementer.nil()) {
if (!current.u_change_implementer.nil() && current.u_change_implementer.changes() &&
(!previous.start_date.nil() && !previous.end_date.nil())) {
gs.eventQueue("change.calendar.notify.remove", current, current.u_change_implementer, previous.u_change_implementer);
}
}
// Remove old calendar from current assigned to, due to date changing
else if (!current.u_change_implementer.nil()) {
if ((current.start_date.changes() && !previous.start_date.nil()) ||
(current.end_date.changes() && !previous.end_date.nil())) {
gs.eventQueue("change.calendar.notify.remove", current, current.u_change_implementer, current.u_change_implementer);
}
}
}
A lot of this seems a bit convoluted, but I've tried modifying this so that when the change request goes to Approval Status == Approved, that it then triggers change.calendar.notify and when it reverts to "Not Yet Requested" that it triggers "change.calendar.notify.remove". We don't need it to trigger any other way at this point. This business rule is set to "After" for when to run.
I've tried doing the following:
if (current.approval == "Approved") {
gs.eventQueue("change.calendar.notify", current, current.assigned_to, previous.assigned_to);
}
if (current.approval == "Not Yet Approved") {
gs.eventQueue("change.calendar.notify.remove", current, current.u_change_implementer, previous.u_change_implementer);
}
As this is supposed to run after, the update. Currently how the operation works is:
- Change comes in, Approval is in "Not Yet Requested"
- Change gets updated with all information needed
- User clicks on "Request Approval" UI Action
- Sends approvals to appropriate people
- Once all approvals have been made the change moves Approval to "Approved"
- If the user decides something on the Change needs to be modified, they have to use the UI Action "Rollback" to make changes so this will cancel all approvals and move the change Approval back to "Not Yet Requested"
As of the moment, the neither the change.calendar.notify or change.calendar.notify.remove never gets triggered and I'm not sure why.
Any ideas? Thanks in advance!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2024 09:46 AM
Did you ever figure this out - I am running into the same issue. Everything I've tried has resulted in either multiple notifications being sent or none...
I am just looking for one calendar notification to be sent after the change request has been approved.