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

Meta issue in Update account json

saimeghana
Regular Contributor II
Regular Contributor II

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

18 REPLIES 18

rushikeshvartak
All-Star
All-Star

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

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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

{

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

}


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi ,

As you mentioned, tried with above json getting the same error.

saimeghana_0-1660888676179.png

Thanks,

saimeghana

It seems you have not updated json as you can see above customproperty3 is not used. 

Please provide task type & json 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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

In every else instead of account.custompropertyX use undefined keyword


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi,

Yes, tried with undefined word, showing the error.

saimeghana_0-1660894559222.png

Thanks,

Saimeghana

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}

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes, will try with this and let you know

Thanks,

saimeghana

saimeghana
Regular Contributor II
Regular Contributor II

Hi,

We tried the above solution, still facing same issue,

Please help us to solve this issue

Thanks,

Saimeghana

saimeghana
Regular Contributor II
Regular Contributor II

Issue solved 

Thanks,

saimeghana

Dave
Community Manager
Community Manager

To help others who may be in a similar situation, what was the solution? 

saimeghana
Regular Contributor II
Regular Contributor II

Solution:  we need to use task.accountKey.custompropertyX binding variable.

Thanks,

saimeghana

avinashchhetri
Saviynt Employee
Saviynt Employee

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

 

 

Regards,
Avinash Chhetri

ASA
Regular Contributor II
Regular Contributor II

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)

@uthra_rahul 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

uthra_rahul
Saviynt Employee
Saviynt Employee

Noted, Rushikesh.

@JayashreeL Please check and update the doc. Thanks!