Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

CheckForUnique not working as expected

sdey_2023
Regular Contributor
Regular Contributor

We have a logic defined in the CheckForUnique ADSI connector to check for the uniqueness of UserPrincipalName during provisioning. But it is failing to provision the account of a User throwing UPN already Exists error although as per the logic defined it should append 1 and provision.

I have checked couple of other posts where Users have reported of similar issue being faced. Can you confirm if this is a bug with Saviynt?

We are using the below code for the UPN uniqueness check and generation but if there is a User with same firstname and lastname and CP45 as O for both, it is failing.

CheckForUnique Code Snippet:

{
"userprincipalname": "CUSTOMPROPERTY3",
"RuleCheck": "${if((user.customproperty45!='O' || user.customproperty45 == null) && user.employeeType== 'Employee' ) {user.email.substring(0,user.email.indexOf('@')) + '@abc.com'} else if ((user.customproperty45!='O' || user.customproperty45 == null) && user.employeeType== 'External' ) {user.email.substring(0,user.email.indexOf('@')) + '@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname!=null && user?.lastname!=null) {user.firstname + '.' + user.lastname + '@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname==null && user?.lastname!=null) {user.lastname + '@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname!=null && user?.lastname==null) {user.firstname + '@contractor.abc.com'} else if(user?.email.contains('cognizant') || user?.email.contains('accenture')) {user.customproperty2.substring(1) + '@qa.abcqa.local'}}###${if((user.customproperty45!='O' || user.customproperty45 == null) && user.employeeType== 'Employee' ) {user.email.substring(0,user.email.indexOf('@')) + '1@abc.com'} else if ((user.customproperty45!='O' || user.customproperty45 == null) && user.employeeType== 'External' ) {user.email.substring(0,user.email.indexOf('@')) + '1@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname!=null && user?.lastname!=null) {user.firstname + '.' + user.lastname + '1@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname==null && user?.lastname!=null) {user.lastname + '1@contractor.abc.com'} else if(user.customproperty45=='O' && user?.email == null && user?.firstname!=null && user?.lastname==null) {user.firstname + '1@contractor.abc.com'} else if(user?.email.contains('xyz') || user?.email.contains('def')) {user.customproperty2.substring(1) + '@qa.abcqa.local'}}"
}

1 REPLY 1

rushikeshvartak
All-Star
All-Star

Did you validated code in v24.x version ?


Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.