and more in a single search tool across platforms. Read the announcement here. |
01/22/2024 11:47 PM
Hi Team,
We have configured create account json for provisioning accounts in AD. But while trying to execute the create user task it fails with an error. The error screenshot and logs is attached for your reference. Please find the create account json mentioned below. The create user json is working if we remove proxy address and title attribute from the json. Please provide input on this issue.
{
"c": "${if(user.country=='Australia'){'AU'} else{''}}",
"cn": "${user.username}",
"co": "${user.country}",
"countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
"company": "${user.companyname}",
"department": "${user.customproperty38}",
"departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"description": "${'Provisioned by IAM'+ user.startdate}",
"displayname": "${if(user.displayname!=null) {user.dislayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
"employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
"extensionAttribute10": "${user.locationdesc}",
"extensionAttribute11": "${user.departmentname}",
"extensionAttribute12": "${user.customproperty9}",
"extensionAttribute13": "${user.customproperty35}",
"extensionAttribute5": "${user.customproperty44}",
"extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
"extensionAttribute8": "${user.companyname}",
"givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
"homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
"homeDrive": "I:",
"info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"l": "${user.locationdesc}",
"mail": "${user.email}",
"manager": "${managerAccount.customproperty23}",
"name": "${user.username}",
"physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
"postalAddress": "${user.customproperty3}",
"postalCode": "${user.regioncode}",
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'}} else {user.customproperty54}}}}}",
"proxyAddresses:"${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
"sAMAccountName": "${user.username}",
"seeAlso": "${user.customproperty44}",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"userAccountControl": "512",
"userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
"employeeID": "${user.username}",
"pwdLastSet": "0",
"division": "${user.departmentNumber}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
]
}
01/23/2024 07:29 PM
Any suggestion most welcome
01/23/2024 07:44 PM
{
"c": "${if(user.country=='Australia'){'AU'} else{''}}",
"cn": "${user.username}",
"co": "${user.country}",
"countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
"company": "${user.companyname}",
"department": "${user.customproperty38}",
"departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"description": "${'Provisioned by IAM'+ user.startdate}",
"displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
"employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
"extensionAttribute10": "${user.locationdesc}",
"extensionAttribute11": "${user.departmentname}",
"extensionAttribute12": "${user.customproperty9}",
"extensionAttribute13": "${user.customproperty35}",
"extensionAttribute5": "${user.customproperty44}",
"extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
"extensionAttribute8": "${user.companyname}",
"givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
"homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
"homeDrive": "I:",
"info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"l": "${user.locationdesc}",
"mail": "${user.email}",
"manager": "${managerAccount.customproperty23}",
"name": "${user.username}",
"physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
"postalAddress": "${user.customproperty3}",
"postalCode": "${user.regioncode}",
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ (user.customproperty25=='ZOL' ? '(On-Loan)' : (user.customproperty25=='ZRO' ? '(Rotation)' : (user.customproperty25=='ZSE' ? '(Secondment)' : (user.customproperty25=='ZAF' ? '(Acting For)' : user.customproperty54))))}}",
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
"sAMAccountName": "${user.username}",
"seeAlso": "${user.customproperty44}",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"userAccountControl": "512",
"userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
"employeeID": "${user.username}",
"pwdLastSet": "0",
"division": "${user.departmentNumber}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
]
}
I fixed a couple of typos in the code, like 'dislayname' instead of 'displayname', and corrected the syntax in the 'title' field. Please review and use this corrected JSON structure.
01/23/2024 10:15 PM
01/23/2024 10:19 PM
{
"c": "${if(user.country=='Australia'){'AU'} else{''}}",
"cn": "${user.username}",
"co": "${user.country}",
"countryCode": "${if(user.country=='Australia'){'0'} else{'36'}}",
"company": "${user.companyname}",
"department": "${user.customproperty38}",
"departmentNumber": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"description": "${'Provisioned by IAM'+ user.startdate}",
"displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
"employeeType": "${if(user.jobCode!=null){user.jobCode} else {user.customproperty55}}",
"extensionAttribute10": "${user.locationdesc}",
"extensionAttribute11": "${user.departmentname}",
"extensionAttribute12": "${user.customproperty9}",
"extensionAttribute13": "${user.customproperty35}",
"extensionAttribute5": "${user.customproperty44}",
"extensionAttribute7": "${user.customproperty14 + ',' + user.customproperty15}",
"extensionAttribute8": "${user.companyname}",
"givenName": "${if(user.displayname!=null) {user.displayname} else {user.firstname}}",
"homeDirectory": "${if (user.customproperty10 != null && (user.customproperty10.equals('1') || user.customproperty10.equals('2') || user.customproperty10.equals('4'))){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else if (user.customproperty36 != null && user.customproperty10.contains('9025')){'\\\\EAHOBCFP02\\Laptops$\\' + user.username} else {'\\\\EAHOBCFP02\\users$\\' + user.username}}",
"homeDrive": "I:",
"info": "${if(user.costcenter!=null) {user.costcenter} else {user.customproperty60}}",
"l": "${user.locationdesc}",
"mail": "${user.email}",
"manager": "${managerAccount.customproperty23}",
"name": "${user.username}",
"physicalDeliveryOfficeName": "${user.customproperty4 + user.customproperty3}",
"postalAddress": "${user.customproperty3}",
"postalCode": "${user.regioncode}",
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ (user.customproperty25=='ZOL' ? '(On-Loan)' : (user.customproperty25=='ZRO' ? '(Rotation)' : (user.customproperty25=='ZSE' ? '(Secondment)' : (user.customproperty25=='ZAF' ? '(Acting For)' : user.customproperty54))))}}",
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
"sAMAccountName": "${user.username}",
"seeAlso": "${user.customproperty44}",
"sn": "${user.lastname}",
"st": "${user.state}",
"streetAddress": "${user.street}",
"userAccountControl": "512",
"userPrincipalName": "${if(user.email!= null){user.email} else {user.username+'@abc.com'}}",
"employeeID": "${user.username}",
"pwdLastSet": "0",
"division": "${user.departmentNumber}",
"objectClass": [
"top",
"person",
"organizationalPerson",
"user"
]
}
01/23/2024 10:37 PM
Hi Rushikesh,
We have used the proxy addresses attribute as per your suggestion.
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
But still we are receiving the error that is highlighted in the above mail.
01/23/2024 11:19 PM
Hi Rushikesh
Thanks for the reply,
Actually we want liitle bit changes in the code
the user.custompropert54 should be in else condition not as or condition..
Can you please help on this
01/24/2024 05:04 AM
Hi @ARNAB86
Replace this line:
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'}} else {user.customproperty54}}}}}",
With this modified line:
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'} else {user.customproperty54}}}} else {''}}}",
Please validate.
01/24/2024 09:55 PM
We have modified the json as per your suggestion. But we are still receiving 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: SimpleTemplateScript36.groovy: 31: expecting '}', found '+' @ line 31, column 103. !=null) {user.customproperty54+ if(user. ^ 1 error"
01/24/2024 10:20 PM
Share latest json
01/24/2024 10:29 PM
Hi Rushikesh
Please find the json
"title": "${if(user.customproperty34!=null && user.customproperty25!=null) {user.customproperty34+ if(user.customproperty25='ZOL') {'(On-Loan)'}else{if(user.customproperty25='ZRO'){'(Rotation)'}else{if(user.customproperty25='ZSE'){'(Secondment)'}else{if(user.customproperty25='ZAF'){'(Acting For)'} else {user.customproperty54}}}} else {''}}}",
01/24/2024 10:36 PM
{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}
01/24/2024 10:50 PM
Hi rushikesh,
The below code as suggested throwing error in json validator
{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}
error
Error: Parse error on line 2: {"title": "${(user.customprope ----------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
can you please suggest
01/23/2024 09:40 PM
Hi @Prajna,
We are checking on your request and we will keep you posted.
01/23/2024 09:42 PM
It seems there are a couple of issues in your JSON configuration. Let's address them:
1. **Typo in the JSON structure:**
There is a typo in the "proxyAddresses" attribute. It should not have a colon after the attribute name. It should be a colon instead. Here's the corrected line:
```json
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
```
2. **Typo in the attribute name:**
There is a typo in the "displayname" attribute. You have written "dislayname" instead of "displayname". Here's the corrected line:
```json
"displayname": "${if(user.displayname!=null) {user.displayname} else{user.firstname.substring(0, 1).toUpperCase()+user.firstname.substring(1)+user.lastname.substring(0, 1).toUpperCase()+user.lastname.substring(1)}}",
```
After making these corrections, your JSON should work better. If the issue persists or if there are additional errors, you may want to review the error messages or logs for more details on what went wrong during the execution.
01/23/2024 10:45 PM
Hi Team,
We have used this code but still getting the error
Thanks
Arnab Pal
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){'smtp:'+user.username+'@abc.com.au'+','+SMTP:'+user.firstname+'.'+user.lastname+'@abc.com'}else{'smtp:'+user.username+'@xyz.com.au'+','+'SMTP:'+user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
01/24/2024 07:39 PM
Hi Thanks for the update but getting error still in the proxyaddress which you have suggested
"proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
01/24/2024 08:17 PM
Please share error logs
01/24/2024 10:58 PM
01/25/2024 07:16 PM
title issue solved ?
01/25/2024 07:32 PM
Hi Rushikesh
no the code below it’s throwing error in json validator
{
"title": "${(user.customproperty34 != null && user.customproperty25 != null) ?
user.customproperty34 +
(user.customproperty25 == 'ZOL' ? '(On-Loan)' :
user.customproperty25 == 'ZRO' ? '(Rotation)' :
user.customproperty25 == 'ZSE' ? '(Secondment)' :
user.customproperty25 == 'ZAF' ? '(Acting For)' : user.customproperty54) :
''}"
}
01/25/2024 07:34 PM
and also getting error for below proxy address as well
proxyAddresses": "${if(user.departmentname!='PLUS ES'){smtp:user.username+'@abc.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@abc.com'}else{smtp:user.username+'@xyz.com.au'+','+SMTP:user.firstname+'.'+user.lastname+'@xyz.com.au'}}",
01/23/2024 11:29 PM
Please help on this