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

Create Account JSON failing in Active Directory with error

Arita
New Contributor II
New Contributor II

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"
]
}

4 REPLIES 4

NM
Honored Contributor II
Honored Contributor II

Hi @Arita , few closing parenthesis are missing in above highlighted code

Raghu
All-Star
All-Star

@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"
]
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

Arita
New Contributor II
New Contributor II

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

@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"
]
}


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.