Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/17/2022 02:48 AM
Hi,
We are trying to update the json where requirements was firstname,lastname,enddate & departmentnumber should get update only for contractors.
For employees only secondary branch code attribute should get update.
We tried with this JSON, having error:
"Error while Update operation for account-0065E20628 in AD - No such property: customproperty3 for class: java.lang.String"
JSON:
{
"givenName":"${if(user.employeeType=='Permanent Employee' ){task.account.customproperty3}else{user.firstname}}",
"sn":"${if(user.employeeType=='Permanent Employee'){task.account.customproperty8}else{user.lastname}}",
"departmentNumber5":"${if(user.employeeType=='Permanent Employee'){task.account.customproperty4}else{user.departmentNumber}}",
"enddate":"${if(user.employeeType=='Permanent Employee'){task.account.customproperty5}else{user.enddate.format('ddMMyyyy')}}",
"AdeccoADNextOU":"${user.customproperty12}"
}
JSON:
{
"givenName":"${if(user.employeeType=='Permanent Employee' ){account.customproperty3}else{user.firstname}}",
"sn":"${if(user.employeeType=='Permanent Employee'){account.customproperty8}else{user.lastname}}",
"departmentNumber5":"${if(user.employeeType=='Permanent Employee'){account.customproperty4}else{user.departmentNumber}}",
"enddate":"${if(user.employeeType=='Permanent Employee'){account.customproperty5}else{user.enddate.format('ddMMyyyy')}}",
"AdeccoADNextOU":"${user.customproperty12}"
}
Please help us to solve this issue.
Thanks,
Saimeghana
Solved! Go to Solution.
08/17/2022 11:47 AM
Dont write else condition it will work
{
"givenName":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee') ){user.firstname}}",
"sn":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.lastname}}",
"departmentNumber5":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.departmentNumber}}",
"enddate":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.enddate.format('ddMMyyyy')}}",
"AdeccoADNextOU":"${user.customproperty12}"
}
08/17/2022 11:00 PM
Hi,
We tried without else condition in Json, we got error "Error while Update operation for account-0065E20315 in AD - [LDAP: error code 65 - Object Class Violation]"
Thanks,
Saimeghana
08/18/2022 03:47 AM - edited 08/18/2022 03:48 AM
{
"givenName":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee') ){user.firstname}else{undefined}}",
"sn":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.lastname}else{undefined}}",
"departmentNumber5":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.departmentNumber}else{undefined}}",
"enddate":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.enddate.format('ddMMyyyy')}elss{undefined}}",
"AdeccoADNextOU":"${user.customproperty12}"
}
08/18/2022 10:59 PM
Hi ,
As you mentioned, tried with above json getting the same error.
Thanks,
saimeghana
08/19/2022 12:20 AM
It seems you have not updated json as you can see above customproperty3 is not used.
Please provide task type & json
08/19/2022 12:27 AM
Hi,
Tried with this json.
{
"givenName":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee') ){user.firstname}else{account.customproperty3}}",
"sn":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.lastname}else{account.customproperty8}}",
"departmentNumber5":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.departmentNumber}else{account.customproperty4}}",
"enddate":"${if(!user.employeeType.equalsIgnoreCase('Permanent Employee')){user.enddate.format('ddMMyyyy')}else{account.customproperty5}}",
"AdeccoADNextOU":"${user.customproperty12}"
}
Task type: Update account task.
Thanks,
Saimeghana
08/19/2022 12:33 AM
In every else instead of account.custompropertyX use undefined keyword
08/19/2022 12:36 AM
Hi,
Yes, tried with undefined word, showing the error.
Thanks,
Saimeghana
08/19/2022 12:49 AM - edited 08/19/2022 12:57 AM
task.accountKey.custompropertyX
Or
arsTasks.accountKey.custompropertyX
If above doesn't work then on request form you need to display read only dynamic attribute n pass into json
Example
Firstname_update : pull from cp3
In json ${Firstname_update}
08/19/2022 01:00 AM
Yes, will try with this and let you know
Thanks,
saimeghana
08/21/2022 11:57 PM
Hi,
We tried the above solution, still facing same issue,
Please help us to solve this issue
Thanks,
Saimeghana
10/17/2022 04:06 AM
Issue solved
Thanks,
saimeghana
10/17/2022 08:09 AM
To help others who may be in a similar situation, what was the solution?
10/18/2022 12:27 AM
Solution: we need to use task.accountKey.custompropertyX binding variable.
Thanks,
saimeghana
08/17/2022 05:09 PM
Hello @saimeghana,
You could do an if else and have a set of specific things done for Employee and specific things for "others" and a common action for both. for e.g.
{
${if (user?.employeeType.equals('Permanent Employee'))
'\"moveUsertoOU\" : \"ou=Employees,ou=Terminated,dc=na,dc=mycompany,dc=com\",
\"description\" : \"Terimated\",'
else
'\"moveUsertoOU\" : \"ou=Contractors,ou=Terminated,dc=na,dc=mycompany,dc=com\",
\"description\" : \"Contract End\",'
}
"removeAction":"SUSPEND",
"deleteAllGroups":"Yes",
"useraccountcontrol":"514"
}
01/11/2023 08:18 AM
We've just spend a lot of time on the same issue, because documentation says that "account" is one of the binding variables. This should realy be fixed/mentioned in the docs:
Configuring the Integration for Provisioning and Deprovisioning Accounts (saviyntcloud.com)
01/11/2023 08:25 AM
01/11/2023 11:15 AM
Noted, Rushikesh.
@JayashreeL Please check and update the doc. Thanks!