Share all details related to your problem, including any error messages you may have received.
Hello, fellow sailors!
I’m currently trying to add Sunrise/Sunset dates to specific entitlements automatically when they are selected in Manage User Access.
(I’ve already tried adding this during the BeforeProvisioning rule. Although Sunrise/Sunset dates appeared in the Access Request, the sunset Request object didn’t generate.)
Does anyone know what workflow or rule is triggered by the time you get to the “Review and Submit” screen? I need to apply the dates similar to the calendar widget, but without someone physically clicking the calendar.
Added a “Apply Sunrise/Sunset Dates” step to the our main LCM Provisioning workflow before the “Initialize” step.
Made sure that I returned the plan generated from that “Apply Sunrise/Sunset Dates” step.
Removed the adding of the Sunrise date, as same day adds don’t work through the UI since everything has to be set at midnight, and midnight has already passed today. So, programmatically, had to utilize the same pattern.
Below is a small snippet of the main code that actually applies the Sunset date. You’ll need to access the plan attribute to be able to eventually to get to this point.
// Setting Sunset only since IdentityIQ does not recognize same day activations since the start time is midnight of that day, and midnight has already passed today.
Calendar calendar = Calendar.getInstance();
/* SUNSET:
Expiration date needs to be 30 days in the future at midnight.
*/
calendar.add(Calendar.DATE, 30);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date sunset = calendar.getTime();
attributeRequest.setRemoveDate(sunset);