and more in a single search tool across platforms. Read the announcement here. |
12/07/2023 01:27 AM - edited 12/07/2023 01:28 AM
Hello Team ,
I need some small suggestion , basically in our AD connector we have logic like below:
for creating sAMAccountName:
ACCOUNTNAMERULE
"sAMAccountName": "${user.customproperty20}${user.customproperty22}",
for creating DN:
CREATEACCOUNTJSON
${if(user.departmentname.equals('Claims'))
{'CN='+user.lastname+'\\, '+user.firstname+' '+user.customproperty22+',OU=Domain Users,DC=test,DC=co,DC=in'}
Now we are planning to implement this logic i.e. if cp22==null then sAMAccountname/CN=cp20 , else cp20+cp22 concatenated.
For this i have written like below but seems i am missing some format please suggest:
UPDATED ACCOUNTNAMERULE:
"sAMAccountName": "${user.customproperty22==null?user.customproperty20:user.customproperty20user.customproperty22}"
UPDATED CREATEACCOUNTJSON:
${if(user.departmentname.equals('Claims'))
{'CN='+user.lastname+'\\, '+user.firstname+' '+{if(user.customproperty22==null){user.customproperty20}else {user.customproperty20user.customproperty22}}+',OU=Domain Users,DC=test,DC=co,DC=in'}
These are not working , i know its due to formatting or so , Please suggest.
Also when i want to write cp20and cp22 concatenated form inside else block ,do I need to use like 'cp20&cp22' or so ?
12/10/2023 09:40 PM
@Diptansu11 can you refer a sample below :
${if(user.customproperty19 != null && user.customproperty19 != '' && (user.customproperty19 =='xx' || user.customproperty19 =='XXX' )) {if(user.customproperty7!=null && user.customproperty7!= '' && user.customproperty7.startsWith('ABCD')){if(user.lastname!=null && user.lastname != ''){'CN=ABCD.'+user.systemUserName.toUpperCase().charAt(0)+user.systemUserName.substring(1,user.systemUserName.indexOf('.'))+' '+user.systemUserName.toUpperCase().charAt(user.systemUserName.indexOf('.')+1)+user.systemUserName.substring(user.systemUserName.indexOf('.')+2)+',OU=Users,OU='+user.customproperty20+',OU=xx,DC=xx,DC=xx'} else{'CN=ABCD.'+user.systemUserName.toUpperCase().charAt(0)+user.systemUserName.substring(1,user.systemUserName.indexOf('.'))+user.systemUserName.substring(user.systemUserName.indexOf('.')+1)+',OU=Users,OU='+user.customproperty20+',OU=xx,DC=xx,DC=xx'}} else{if(user.lastname!=null && user.lastname != ''){'CN='+user.systemUserName.toUpperCase().charAt(0)+user.systemUserName.substring(1,user.systemUserName.indexOf('.'))+' '+user.systemUserName.toUpperCase().charAt(user.systemUserName.indexOf('.')+1)+user.systemUserName.substring(user.systemUserName.indexOf('.')+2)+',OU=Users,OU='+user.customproperty20+',OU=xx,DC=xx,DC=xx'} else{'CN='+user.systemUserName.toUpperCase().charAt(0)+user.systemUserName.substring(1,user.systemUserName.indexOf('.'))+user.systemUserName.substring(user.systemUserName.indexOf('.')+1)+',OU=Users,OU='+user.customproperty20+',OU=xx,DC=xx,DC=xx'}}}}
12/12/2023 09:12 AM
Hi @Diptansu11
Could you please try with the below syntax.
${if(user.customproperty22==null)
{'CN='+user.customproperty20}
else{'CN='+user.customproperty20+user.customproperty22}
Also please refer the below post.
Solved: AD AccountNameRule using else - Saviynt Forums - 57443
Regards,
Dhruv Sharma