Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Update account Json is not working

BhanuKumar
New Contributor
New Contributor

Below Json is not working to AD based connector.

{
"objects": [{
"objectClasses": ["user", "person", "organizationalPerson", "top"],
"distinguishedName": "${account.accountID?.replace('\\', '\\\\')?.replace('/', '\\/')}",
"attributes":
{
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}",
}
}]
}

license and access are dynamic attributes.

When a request is raised for access, it is working as expected but after the task completed value is not getting added in AD.

Let me know if there is any syntactical error in code.

Thanks

Bhanu kumar

6 REPLIES 6

dgandhi
All-Star
All-Star

What is the error in the logs?

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Hello,

Error in logs is as below:

status:Success, message:Failed to update attributes., messageCodes:OBJ_ERR_00022, errorDetails:OBJ_ERR_00022 : -2147467261 : Object reference not set to an instance of an object.]], connectionString:LDAP://na.xerox.org

Thanks

sk
All-Star
All-Star

Do you need to update objectclass and distinguishedName in case update account?

Also please try to use below JSON and see if it makes any difference?

{
"objectClasses": ["user", "person", "organizationalPerson", "top"],
"distinguishedName": "${account.accountID?.replace('\\', '\\\\')?.replace('/', '\\/')}",
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"
}

If object class and DN are not required to change on update please remove them and try as below

{
"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"
}


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

BhanuKumar
New Contributor
New Contributor

it is not working.

The Task gets completed successfully but the extensionattribute values is not updated . Looks like a logical / syntax error 

What if hardcoded value


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

BhanuKumar
New Contributor
New Contributor

Hi Rushikesh,

If the values are hardcoded, they are getting added in AD.

if conditions are used they are not.

"msDS-cloudExtensionAttribute1": "${if(user?.statuskey == 0){'NL'}else if(license == 'ABC' && access == 'YES'){('X')}else {''}}",
"msDS-cloudExtensionAttribute2": "${if(user?.statuskey == 0){'NL'}else if(license == 'XYZ' && access == 'YES'){('Y')}else {''}}",
"msDS-cloudExtensionAttribute3": "${if(user?.statuskey == 0){'NL'}else if(license == 'PQR' && access == 'YES'){('Z')}else {''}}"

Thanks