Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

CHECKFORUNIQUE doesn't seem to work for UPDATEACCOUNTJSON in displaName

benedict
New Contributor
New Contributor

I need to check for unique value of displayName and cn in AD before updating the account, but unfortunately, Saviynt only provisioned same displayName to multiple users with same name in AD. The same code applies to the ACCOUNTNAMERULE but i doesn't work when i map the cn to displayName in UPDATEACCOUNT JSON. 

Below is sample of the code in CHECKFOR UNIQUE config.

 

{"displayName":"${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + user.preferedFirstName + ', ' + user.companyname : user.lastname + ' ' + user.preferedFirstName + ', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ')[0] + ', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') +', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 1'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 1'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 1'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 2'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 2'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 2'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 3'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 3'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 3'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 4'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 4'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 4'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 5'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 5'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 5'+', ' + (user.customproperty28 ?: user.companyname);}","cn":"${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + user.preferedFirstName + ', ' + user.companyname : user.lastname + ' ' + user.preferedFirstName + ', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ')[0] + ', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') +', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 1'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 1'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 1'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 2'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 2'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 2'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 3'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 3'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 3'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 4'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 4'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 4'+', ' + (user.customproperty28 ?: user.companyname);}###${user.preferedFirstName != null ? (user.customproperty28 == null ? user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 5'+', ' + user.companyname : user.lastname + ' ' + (user.preferedFirstName + ' ' + (user.firstname.split(' ').length > 1 ? user.firstname.split(' ')[1] : ''))?.trim() + ' 5'+', ' + user.customproperty28) : user.lastname + ' ' + user.firstname.split(' ').take(2).join(' ') + ' 5'+', ' + (user.customproperty28 ?: user.companyname);}"}

4 REPLIES 4

rushikeshvartak
All-Star
All-Star
  • Can you share logs

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Please find the logs attached 

Does same displayname contains under same OU ?


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes. DisplayName belongs to the same OU