Click HERE to see how Saviynt Intelligence is transforming the industry. |
05/31/2024 11:36 AM
Hi Team,
We are getting an error with task failure as below for create account JSON: Error is around the highlighted conditions in the JSON. Anyone can fix it.
Error: Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript208.groovy: 37: expecting '}', found ':' @ line 37, column 114. !=null) {user.customproperty51:''} else ^ 1 error
Create Account JSON:
{
"employeeID": "${user.employeeid ==null? user.username:user.employeeid}",
"c": "${user.country}",
"co": "${user.customproperty32}",
"countrycode": "${user.customproperty33}",
"company": "${user.customproperty17}",
"department": "${(user.departmentname == null || user.departmentname.length()<64)?user.departmentname:user.departmentname.substring(0,64)}",
"displayName": "${user.displayname}",
"division": "${user.customproperty16}",
"employeeType": "${user.employeeType}",
"manager": "${managerAccount==null?'':managerAccount?.comments}",
"extensionAttribute1": "${user.employeeid ==null? user.username:user.employeeid}",
"msExchExtensionAttribute24": "${user.country =='US'? 'US':'INTL'}",
"msExchExtensionAttribute23": "${user.employeeType =='Employee'? 'FTE':'NE'}",
"telephoneNumber": "${user.phonenumber}",
"extensionAttribute8": "${user.customproperty27}",
"extensionAttribute13": "${user.locationnumber}",
"extensionAttribute14": "${user.customproperty27}",
"extensionAttribute15": "${user.startdate.format('yyyy-MM-dd')}",
"extensionAttribute6": "${user.customproperty12}",
"msExchExtensionAttribute43": "Okta",
"givenName": "${user.preferedFirstName}",
"l": "${user.city}",
"physicalDeliveryOfficeName": "${user.locationdesc}",
"WMAD-ExtensionString67": "Primary",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"sAMAccountName": "${task.accountName}",
"userPrincipalName": "${user.email}",
"mail": "${user.email}",
"title": "${(user.title == null || user.title.length()<64)?user.title:user.title.substring(0,64)}",
"postalcode": "${user.customproperty13}",
"userAccountControl": "512",
"WMAD-ExtensionString63": "${user?.customproperty20?.contains('Workday') ? user.costcenter : ''}",
"msExchUsageLocation": "US",
"erp-customID":"${(user.customproperty20 == 'Workday' && user.customproperty51 != null) ? user.customproperty51 : (user.customproperty20 == 'tvn' ? user.systemUserName.substring(3, 8: '')}"
"WMAD-ExtensionString78": "${user.employeeid ==null? user.username:user.employeeid}",
"erp-compcode": "${(user.customproperty20 == 'Workday' && user.customproperty51 != null) || user.customproperty20 == 'tvn' ? user.customproperty14 : ''}"
"adminDescription": "Saviynt",
"objectclass": [
"top",
"person",
"organizationalPerson",
"user"
]
}
Solved! Go to Solution.
05/31/2024 01:54 PM
Hi @Arita , few closing parenthesis are missing in above highlighted code
06/01/2024 12:26 AM
@Arita try below
{
"employeeID": "${user.employeeid ==null? user.username:user.employeeid}",
"c": "${user.country}",
"co": "${user.customproperty32}",
"countrycode": "${user.customproperty33}",
"company": "${user.customproperty17}",
"department": "${(user.departmentname == null || user.departmentname.length()<64)?user.departmentname:user.departmentname.substring(0,64)}",
"displayName": "${user.displayname}",
"division": "${user.customproperty16}",
"employeeType": "${user.employeeType}",
"manager": "${managerAccount==null?'':managerAccount?.comments}",
"extensionAttribute1": "${user.employeeid ==null? user.username:user.employeeid}",
"msExchExtensionAttribute24": "${user.country =='US'? 'US':'INTL'}",
"msExchExtensionAttribute23": "${user.employeeType =='Employee'? 'FTE':'NE'}",
"telephoneNumber": "${user.phonenumber}",
"extensionAttribute8": "${user.customproperty27}",
"extensionAttribute13": "${user.locationnumber}",
"extensionAttribute14": "${user.customproperty27}",
"extensionAttribute15": "${user.startdate.format('yyyy-MM-dd')}",
"extensionAttribute6": "${user.customproperty12}",
"msExchExtensionAttribute43": "Okta",
"givenName": "${user.preferedFirstName}",
"l": "${user.city}",
"physicalDeliveryOfficeName": "${user.locationdesc}",
"WMAD-ExtensionString67": "Primary",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"sAMAccountName": "${task.accountName}",
"userPrincipalName": "${user.email}",
"mail": "${user.email}",
"title": "${(user.title == null || user.title.length()<64)?user.title:user.title.substring(0,64)}",
"postalcode": "${user.customproperty13}",
"userAccountControl": "512",
"WMAD-ExtensionString63": "${user?.customproperty20?.contains('Workday') ? user.costcenter : ''}",
"msExchUsageLocation": "US",
"erp-customID":"${(user.customproperty20 == 'Workday' && user.customproperty51 != null) ? user.customproperty51 : (user.customproperty20 == 'tvn' ? user.systemUserName.substring(3, 8: ''))}"
"WMAD-ExtensionString78": "${user.employeeid ==null? user.username:user.employeeid}",
"erp-compcode": "${((user.customproperty20 == 'Workday' && user.customproperty51 != null) || user.customproperty20 == 'tvn' ? user.customproperty14 : '')}"
"adminDescription": "Saviynt",
"objectclass": [
"top",
"person",
"organizationalPerson",
"user"
]
}
06/01/2024 11:25 AM
Thanks Raghu and NM,
I still see the below error.
Error while creating account in AD - Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: SimpleTemplateScript2441.groovy: 37: expecting ':', found ')' @ line 37, column 196. emUserName.substring(3, 8: ''))}\", ^ 1 error
06/02/2024 04:50 AM
@Arita try below
{
"employeeID": "${user.employeeid == null ? user.username : user.employeeid}",
"c": "${user.country}",
"co": "${user.customproperty32}",
"countrycode": "${user.customproperty33}",
"company": "${user.customproperty17}",
"department": "${(user.departmentname == null || user.departmentname.length() < 64) ? user.departmentname : user.departmentname.substring(0,64)}",
"displayName": "${user.displayname}",
"division": "${user.customproperty16}",
"employeeType": "${user.employeeType}",
"manager": "${managerAccount == null ? '' : managerAccount?.comments}",
"extensionAttribute1": "${user.employeeid == null ? user.username : user.employeeid}",
"msExchExtensionAttribute24": "${user.country == 'US' ? 'US' : 'INTL'}",
"msExchExtensionAttribute23": "${user.employeeType == 'Employee' ? 'FTE' : 'NE'}",
"telephoneNumber": "${user.phonenumber}",
"extensionAttribute8": "${user.customproperty27}",
"extensionAttribute13": "${user.locationnumber}",
"extensionAttribute14": "${user.customproperty27}",
"extensionAttribute15": "${user.startdate.format('yyyy-MM-dd')}",
"extensionAttribute6": "${user.customproperty12}",
"msExchExtensionAttribute43": "Okta",
"givenName": "${user.preferedFirstName}",
"l": "${user.city}",
"physicalDeliveryOfficeName": "${user.locationdesc}",
"WMAD-ExtensionString67": "Primary",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"sAMAccountName": "${task.accountName}",
"userPrincipalName": "${user.email}",
"mail": "${user.email}",
"title": "${(user.title == null || user.title.length() < 64) ? user.title : user.title.substring(0,64)}",
"postalcode": "${user.customproperty13}",
"userAccountControl": "512",
"WMAD-ExtensionString63": "${user?.customproperty20?.contains('Workday') ? user.costcenter : ''}",
"msExchUsageLocation": "US",
"erp-customID": "${(user.customproperty20 == 'Workday' && user.customproperty51 != null) ? user.customproperty51 : (user.customproperty20 == 'tvn' ? user.systemUserName.substring(3,8) : '')}",
"WMAD-ExtensionString78": "${user.employeeid == null ? user.username : user.employeeid}",
"erp-compcode": "${(user.customproperty20 == 'Workday' && user.customproperty51 != null) || user.customproperty20 == 'tvn' ? user.customproperty14 : ''}",
"adminDescription": "Saviynt",
"objectclass": [
"top",
"person",
"organizationalPerson",
"user"
]
}