Hi Community,
I am working on a transform to move users to specific “Disabled” OUs based on their distinguishedName and cloudLifecycleState.
The Goal:
-
If the user is
terminatedormanualTerminated:-
Check if their current AD DN contains “india”.
-
If yes: Move to the India Disabled OU.
-
If no: Move to the USA Disabled OU.
-
-
If they are active, return their current
distinguishedName.
The Issue: I keep receiving an “Error rendering template” or “Exception while calculating value.” I suspect it is related to how variables are passed into the nested positiveCondition or how null values are handled for users without an AD account.
Here’s the current JSON:
{
"name": "Disabled Ou Movement - Transform",
"type": "conditional",
"attributes": {
"expression": "$cloudLifecycleState == 'terminated' || $cloudLifecycleState == 'manualTerminated'",
"positiveCondition": {
"type": "conditional",
"attributes": {
"dn": {
"type": "accountAttribute",
"attributes": {
"sourceName": "Active Directory",
"attributeName": "distinguishedName"
}
},
"sAMAccountName": {
"type": "accountAttribute",
"attributes": {
"sourceName": "Active Directory",
"attributeName": "sAMAccountName"
}
},
"expression": "dn.toLowerCase().contains('india')",
"positiveCondition": {
"type": "static",
"attributes": {
"value": "CN=$sAMAccountName,OU=Disabled Accounts,OU=Users,OU=India,DC=spdev,DC=local"
}
},
"negativeCondition": {
"type": "static",
"attributes": {
"value": "CN=$sAMAccountName,OU=Disabled Accounts,OU=Users,OU=USA,DC=spdev,DC=local"
}
}
}
},
"negativeCondition": {
"type": "accountAttribute",
"attributes": {
"sourceName": "Active Directory",
"attributeName": "distinguishedName"
}
}
}
}
Questions for the experts:
-
Do I need to re-declare
sAMAccountNameanddninside the nestedpositiveConditionattributes block? -
How can I safely handle the
.contains()check if thedistinguishedNameattribute is null for a specific user? -
Is there a more efficient way to achieve this using a single
statictransform with Velocity instead of nested conditionals?
Any guidance would be greatly appreciated!