Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
07/15/2024 12:24 PM - edited 07/15/2024 12:33 PM
Hi All
Facing issues when i am passing accounts.customproperty values in the moveObjectToOU. The whole json is passed as a string while provisioning and the task fails. But when i replace the if else statement with a static value the JSON works well.
WHAT WORKS
{
"objects":[{"objectClasses":["user"],
"distinguishedName": "${accounts.accountID.replace('\\', '\\\\')?.replace('/', '\\/')}",
"moveObjectToOU": "OU=Disabled Users,DC=plhgroupinc,DC=net",
"attributes":{"userAccountControl":514}
}]}
Here is what i have tried for my usecase to pass validate a account customproperty
{
"objects":[{"objectClasses":["user"],
"distinguishedName": "${account.accountID.replace('\\', '\\\\')?.replace('/', '\\/')}",
"moveObjectToOU": "${if(account.customproperty2 == ('PLH Group, Inc')){'OU=Disabled Users,DC=plhgroupinc,DC=net'} else {'OU=Disabled Users,DC=plhgroupinc,DC=net'}}",
"attributes":{"userAccountControl":514}
}]}
{
"objects":[{"objectClasses":["user"],
"distinguishedName": "${account.accountID.replace('\\', '\\\\')?.replace('/', '\\/')}",
"moveObjectToOU": "${if(accountsObj?.customproperty2 == ('PLH Group, Inc')){'OU=Disabled Users,DC=plhgroupinc,DC=net'} else {'OU=Disabled Users,DC=plhgroupinc,DC=net'}}",
"attributes":{"userAccountControl":514}
}]}
{
"objects":[{"objectClasses":["user"],
"distinguishedName": "${account.accountID.replace('\\', '\\\\')?.replace('/', '\\/')}",
"moveObjectToOU": "${if(account.customproperty2.equals('PLH Group, Inc')){'OU=Disabled Users,DC=plhgroupinc,DC=net'} else {'OU=Disabled Users,DC=plhgroupinc,DC=net'}}",
"attributes":{"userAccountControl":514}
}]}
I know the issue lies in the IF-ELSE statement only. Has anyone seen this issue? Is there is limit with the customproperty number that is exposed for the account binding variable?
07/15/2024 01:29 PM
{
"objects": [{
"objectClasses": ["user"],
"distinguishedName": "${accounts.accountID.replace('\\', '\\\\')?.replace('/', '\\/')}",
"moveObjectToOU": "${accounts.customproperty2 == 'PLH Group, Inc' ? 'OU=Disabled Users,DC=plhgroupinc,DC=net' : 'OU=Disabled Users,DC=plhgroupinc,DC=net'}",
"attributes": {
"userAccountControl": 514
}
}]
}