Hello,
I need to implement a transform to determine the license of accounts based on their lifecycle state. I used a conditional transform, but I’m having trouble with the expression. I don’t know why the OR operator doesn’t seem to be recognized from the system. Any tips?
{
“name”: “License_Status”,
“type”: “conditional”,
“attributes”: {
“expression”: “$lifecycleState eq terminated || $lifecycleState eq inactive”,
“positiveCondition”: “unlicensed”,
“negativeCondition”: “$licenseStatus”,
“lifecycleState”: {
“attributes”: {
“name”: “cloudLifecycleState”
},
“type”: “identityAttribute”
},
“licenseStatus”: {
“type”: “static”,
“attributes”: {
“value”: “#if($identity.getLinks().size()<=3)light#{else}licensed#end”
}
}
},
“internal”: false
}
Hi @Vittoria!
Please put triple-ticks around your code blocks so they’re properly formatted; this is hard to read in its current format.
{
"name": "License_Status",
"type": "conditional",
"attributes": {
"expression": "$lifecycleState eq terminated || $lifecycleState eq inactive",
"positiveCondition": "unlicensed",
"negativeCondition": "$licenseStatus",
"lifecycleState": {
"attributes": {
"name": "cloudLifecycleState"
},
"type": "identityAttribute"
},
"licenseStatus": {
"type": "static",
"attributes": {
"value": "#if($identity.getLinks().size()<=3)light#{else}licensed#end"
}
}
},
"internal": false
}
the conditional transform does not appear to support the or
operator. per the documentation, the eq operator is the only valid comparison
.
the better way to handle this would be a static transform where the comparison is all made with Velocity, like you’re doing with your licenseStatus
variable.
1 Like
Try this,
{
"name": "License_Status",
"type": "static",
"attributes": {
"lifecycleState": {
"attributes": {
"name": "cloudLifecycleState"
},
"type": "identityAttribute"
},
"licenseStatus": {
"type": "static",
"attributes": {
"value": "#if($identity.getLinks().size()<=3)light#{else}licensed#end"
}
},
"value": "#if(($lifecycleState == 'terminated' || $lifecycleState == 'inactive')unlicensed#{else}$licenseStatus#end"
},
"internal": false
}
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.