niket345
(Niket Telavane)
May 29, 2024, 11:43am
1
Which IIQ version are you inquiring about?
Version 8.4
Share all details related to your problem, including any error messages you may have received.
Hello Experts,
I have noticed that WhenChanged attribute is in LDAP timestamp in AD link in IIQ. is there anyway to change that format to yyyy-mm-dd format in SailPoint.
whenChanged 20240522124922.0Z
Thanks
kjakubiak
(Kamil Jakubiak)
May 29, 2024, 11:47am
2
Well, easiest way - CustomizationRule to convert value
Something like that
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="LDAPCustomization" type="ResourceObjectCustomization">
<Source>
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
convertDateFormat(String dateStr) {
// Define the input and output date formats
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss.S'Z'");
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// Parse the input date string to a LocalDateTime object
LocalDateTime dateTime = LocalDateTime.parse(dateStr, inputFormatter);
// Format the LocalDateTime object to the desired format
String formattedDate = dateTime.format(outputFormatter);
return formattedDate;
}
String unixDate = object.get("WhenChanged");
object.put("WhenChanged",convertDateFormat(unixDate));
return object;
</Source>
</Rule>
1 Like
niket345
(Niket Telavane)
May 29, 2024, 11:51am
3
can we use this code for Identity Attribute also?
kjakubiak
(Kamil Jakubiak)
May 29, 2024, 11:52am
4
the date transform yes - but you have to put it into IdentityAttributeSource rule instead of CustomizationRule
EDIT:
I’ve modified it a bit - as there was small bug there - now it should work fine.
2 Likes
system
(system)
Closed
July 28, 2024, 11:52am
5
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.