Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/08/2023 01:44 AM
'\"extensionAttribute2\" : \"user.firstname.toString().toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@xyz.com'\",'
or
'\"extensionAttribute2\" : \"user.firstname.toString().toLowerCase().replaceAll(\" \",\"\")+'.'+user.lastname.toString().toLowerCase().replaceAll(\" \",\"\")+'@xyz.com'\",'
or
'\"extensionAttribute2\" :'+user.firstname.toString().toLowerCase().replaceAll(" ","")+'.'+user.lastname.toString().toLowerCase().replaceAll(" ","")+'@xyz.com\",
08/08/2023 02:35 AM
Hi @asamaddar ,
Can you try below expression and check.
"extensionAttribute2" : "${user.firstname.toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@xyz.com'}"
08/08/2023 05:58 AM
Getting the below error:
Error while Update operation for account-costas in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript2223.groovy: 43: expecting anything but ''\n''; got it anyway @ line 43, column 235. eAll(',',' ')+'@xyz.com'}\" ^ 1 error
08/08/2023 06:03 AM
@asamaddar Can you share your whole createaccountjson and updateaccountjson.
08/08/2023 06:44 AM - last edited on 08/08/2023 07:21 AM by Sunil
UPDATEACCOUNTJSON:
{
"jwsPersonID": "${user.customproperty15}",
"cn": "${user.customproperty25}",
"givenName": "${user.firstname}",
"sn": "${user.lastname}",
"middleName": "${user.middlename}",
"displayName": "${user.displayname}",
"street": "${user.street}",
"streetAddress": "${user.customproperty1}",
"l": "${user.city}",
"st": "${user.state}",
"postalCode": "${user.customproperty2}",
"co": "${user.country}",
"c": "${user.customproperty3}",
"company": "${user.companyname}",
"department": "${user.departmentname}",
"jwsDepartmentName": "${user.departmentname}",
"division": "${user.customproperty42}",
"employeeID": "${user.employeeid}",
"employeeNumber": "${user.employeeid}",
${if(user.statuskey==1)
'\"employeeType\": \"'+user.employeeType.toString()+'\",'
else
'\"employeeType\" : \"terminated\",'
}
"departmentNumber": "${user.departmentNumber}",
"jwsDivisionName": "${user.customproperty42}",
"jwsFunctionName": "${user.customproperty43}",
"jwsGroupName": "${user.customproperty44}",
"jwsHireDate": "${user.customproperty8}",
"jwsTermDate": "${user.customproperty21}",
"title": "${user.title}",
"jwsManager": "${user.customproperty9}",
"manager": "${user.customproperty9}",
${if(user?.customproperty5!=null &&user?.customproperty5.contains('Cross Knowledge'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@cxxxxxxxxxxxxx.com\",\"smtp:'+user.username+'@xxxx.mail.onmicrosoft.com\"],'
else if(user?.companyname!=null && user?.companyname.contains('Mxxxxx'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@mxxxx.com\",\"smtp:'+user.username+'@xxxxx.mail.onmicrosoft.com\"],'
else if(user?.companyname!=null && user?.companyname.contains('Hxxxxx xxxxxx'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@hxxxxx.com\",\"smtp:'+user.username+'@xxxxx.mail.onmicrosoft.com\"],'
else if(user?.email.contains('@wxxxxx.com'))
'\"proxyAddresses\" : [\"SMTP:'+user.email+'\",\"smtp:'+user.username+'@xxxxxx.mail.onmicrosoft.com\"],'
else
'\"proxyAddresses\" : [],'
}
"mail": "${user.email}",
"physicalDeliveryOfficeName": "${user.customproperty12}",
"roomNumber": "${user.customproperty13}",
"sAMAccountName": "${user.username}",
"uid": "${user.customproperty23}",
"extensionAttribute5":"${user.customproperty51}",
"userPrincipalName": "${user.customproperty24}",
"jwsTelephoneExtension": "${user.customproperty10}",
"tcUserID":"${user.customproperty29}",
${if(user?.customproperty59!=null && user?.customproperty59.contains('Axxxxx'))
"extensionAttribute2" : "${user.firstname.toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@axxxxx.com'}"
else
'\"extensionAttribute2\" : [],'
}
"moveUsertoOU": "${user.customproperty26}"
}
--------------------------------------------------
CREATEACCOUNTJSON
{
"objectClass": [
"top",
"person",
"organizationalPerson",
"user",
"jwsPerson",
"jwsObjectIdentifier"
],
"cn": "${user.customproperty25}",
"givenName": "${user.firstname}",
"sn": "${user.lastname}",
"middleName": "${user.middlename}",
"displayName": "${user.displayname}",
"street": "${user.street}",
"streetAddress": "${user.customproperty1}",
"l": "${user.city}",
"st": "${user.state}",
"postalCode": "${user.customproperty2}",
"co": "${user.country}",
"c": "${user.customproperty3}",
"company": "${user.companyname}",
"department": "${user.departmentname}",
"jwsDepartmentName": "${user.departmentname}",
"division": "${user.customproperty42}",
"employeeID": "${user.employeeid}",
"employeeNumber": "${user.employeeid}",
"employeeType": "${user.employeeType}",
"departmentNumber": "${user.departmentNumber}",
"jwsDivisionName": "${user.customproperty42}",
"jwsFunctionName": "${user.customproperty43}",
"jwsGroupName": "${user.customproperty44}",
"jwsHireDate": "${user.customproperty8}",
"jwsTermDate": "${user.customproperty21}",
"title": "${user.title}",
"jwsManager": "${user.customproperty9}",
"manager": "${user.customproperty9}",
"mail": "${user.email}",
"physicalDeliveryOfficeName": "${user.customproperty12}",
"roomNumber": "${user.customproperty13}",
"jwsObjectID": "${user.customproperty14}",
"jwsPersonID": "${user.customproperty15}",
"sAMAccountName": "${user.username}",
"uid": "${user.customproperty23}",
"userPrincipalName": "${user.customproperty24}",
"tcUserID": "${user.customproperty29}",
"userAccountControl": "512",
${if(user?.customproperty59!=null && user?.customproperty59.contains('Axxxxx'))
"extensionAttribute2" : "${user.firstname.toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@axxxxx.com'}"
else
'\"extensionAttribute2\" : [],'
}
"pwdLastSet": "0"
}
[This message has been edited by moderator to mask names]
08/08/2023 07:02 AM - edited 08/08/2023 07:07 AM
Hi @asamaddar ,
Can you try with below CreateAccountJSON and UpdateAccountJSON and check. Syntax were wrong.
Create Account JSON:
{
"objectClass": [
"top",
"person",
"organizationalPerson",
"user",
"jwsPerson",
"jwsObjectIdentifier"
],
"cn": "${user.customproperty25}",
"givenName": "${user.firstname}",
"sn": "${user.lastname}",
"middleName": "${user.middlename}",
"displayName": "${user.displayname}",
"street": "${user.street}",
"streetAddress": "${user.customproperty1}",
"l": "${user.city}",
"st": "${user.state}",
"postalCode": "${user.customproperty2}",
"co": "${user.country}",
"c": "${user.customproperty3}",
"company": "${user.companyname}",
"department": "${user.departmentname}",
"jwsDepartmentName": "${user.departmentname}",
"division": "${user.customproperty42}",
"employeeID": "${user.employeeid}",
"employeeNumber": "${user.employeeid}",
"employeeType": "${user.employeeType}",
"departmentNumber": "${user.departmentNumber}",
"jwsDivisionName": "${user.customproperty42}",
"jwsFunctionName": "${user.customproperty43}",
"jwsGroupName": "${user.customproperty44}",
"jwsHireDate": "${user.customproperty8}",
"jwsTermDate": "${user.customproperty21}",
"title": "${user.title}",
"jwsManager": "${user.customproperty9}",
"manager": "${user.customproperty9}",
"mail": "${user.email}",
"physicalDeliveryOfficeName": "${user.customproperty12}",
"roomNumber": "${user.customproperty13}",
"jwsObjectID": "${user.customproperty14}",
"jwsPersonID": "${user.customproperty15}",
"sAMAccountName": "${user.username}",
"uid": "${user.customproperty23}",
"userPrincipalName": "${user.customproperty24}",
"tcUserID": "${user.customproperty29}",
"userAccountControl": "512",
"extensionAttribute2": "${if(user.customproperty59 != null && user.customproperty59.contains('Atypon')){user.firstname.toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@atypon.com'} else {}}",
"pwdLastSet": "0"
}
Update Account JSON:
{
"jwsPersonID": "${user.customproperty15}",
"cn": "${user.customproperty25}",
"givenName": "${user.firstname}",
"sn": "${user.lastname}",
"middleName": "${user.middlename}",
"displayName": "${user.displayname}",
"street": "${user.street}",
"streetAddress": "${user.customproperty1}",
"l": "${user.city}",
"st": "${user.state}",
"postalCode": "${user.customproperty2}",
"co": "${user.country}",
"c": "${user.customproperty3}",
"company": "${user.companyname}",
"department": "${user.departmentname}",
"jwsDepartmentName": "${user.departmentname}",
"division": "${user.customproperty42}",
"employeeID": "${user.employeeid}",
"employeeNumber": "${user.employeeid}",
${if(user.statuskey==1)
'\"employeeType\": \"'+user.employeeType.toString()+'\",'
else
'\"employeeType\" : \"terminated\",'
}
"departmentNumber": "${user.departmentNumber}",
"jwsDivisionName": "${user.customproperty42}",
"jwsFunctionName": "${user.customproperty43}",
"jwsGroupName": "${user.customproperty44}",
"jwsHireDate": "${user.customproperty8}",
"jwsTermDate": "${user.customproperty21}",
"title": "${user.title}",
"jwsManager": "${user.customproperty9}",
"manager": "${user.customproperty9}",
${if(user?.customproperty5!=null &&user?.customproperty5.contains('Cross Knowledge'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@crossknowledge.com\",\"smtp:'+user.username+'@wiley.mail.onmicrosoft.com\"],'
else if(user?.companyname!=null && user?.companyname.contains('Mthree'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@mthree.com\",\"smtp:'+user.username+'@wiley.mail.onmicrosoft.com\"],'
else if(user?.companyname!=null && user?.companyname.contains('Hindawi Romania'))
'\"proxyAddresses\" : [\"smtp:'+user.email+'\",\"SMTP:'+user.firstname.toString().toLowerCase()+'.'+user.lastname.toString().toLowerCase()+'@hindawi.com\",\"smtp:'+user.username+'@wiley.mail.onmicrosoft.com\"],'
else if(user?.email.contains('@wileyqa.com'))
'\"proxyAddresses\" : [\"SMTP:'+user.email+'\",\"smtp:'+user.username+'@wiley.mail.onmicrosoft.com\"],'
else
'\"proxyAddresses\" : [],'
}
"mail": "${user.email}",
"physicalDeliveryOfficeName": "${user.customproperty12}",
"roomNumber": "${user.customproperty13}",
"sAMAccountName": "${user.username}",
"uid": "${user.customproperty23}",
"extensionAttribute5":"${user.customproperty51}",
"userPrincipalName": "${user.customproperty24}",
"jwsTelephoneExtension": "${user.customproperty10}",
"tcUserID":"${user.customproperty29}",
"extensionAttribute2": "${if(user.customproperty59 != null && user.customproperty59.contains('Atypon')){user.firstname.toLowerCase().replaceAll(',',' ')+'.'+user.lastname.toString().toLowerCase().replaceAll(',',' ')+'@atypon.com'} else {}}",
"moveUsertoOU": "${user.customproperty26}"
}
08/08/2023 08:23 AM
With Update Account JSON I'm getting this - Error while Update operation for account-costas in AD - [LDAP: error code 16 - 00000057: LdapErr: DSID-0C09105D, comment: Error in attribute conversion operation, data 0, v4563]