I have the requirement to sunset expiration to send notification days before 14 and days before 1
But I could see in Global setting we cant send multiple notification.
How we can customize this feature?
Since the out-of-the-box configuration doesn’t support multiple reminders for role expiry, you can try with a custom rule + RunRule task approach, and it works well.
Custom Rule:
Write a rule that loops through all identities, checks their assigned roles, and compares the role’s end date with the current date. If the role is set to expire in 14 or 1 day, it sends a reminder email.
import sailpoint.object.*;
import sailpoint.api.*;
import java.util.*;
Date now = new Date();
List identities = context.getObjects(Identity.class);
for (Identity identity : identities) {
List<Assignment> assignments = identity.getAssignments();
if (assignments == null) continue;
for (Assignment assignment : assignments) {
Date endDate = assignment.getEndDate();
if (endDate == null) continue;
long daysLeft = (endDate.getTime() - now.getTime()) / (1000 * 60 * 60 * 24);
if (daysLeft == 14 || daysLeft == 1) {
EmailOptions options = new EmailOptions();
options.setTo(identity);
options.setVariable("assignment", assignment);
options.setVariable("identity", identity);
context.sendEmail("roleExpiryReminder", options);
}
}
}
return "Role expiry notifications sent.";
RunRule Task:
Create a scheduled task of type RunRule that runs this rule daily. This way, users get timely reminders without any manual intervention.
Email Template:
Create a custom email template (roleExpiryReminder) that includes the role name and expiration date, and sends it to the user.