Entitlements and variables

Scenario - 10,000s of entitlements that need to be assigned via roles. I’ve tried adding variables to the entitlements part of a role but I am getting a 500 error. Is what I am trying to do even achievable?
Here is the snippet that it is failing on:

Blockquote
    "entitlements": [
        {
            "type": "ENTITLEMENT",
            "name": "$number $userType",
            "number": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "number"
                }
            },
            "userType": {
                "type": "identityAttribute",
                "attributes": {
                    "name": "userType"
                }
            }
        }
    ]
Blockquote

Hello @phil_awlings ,

Per my knowledge, this is not possible. On a role, the entitlements only allow for type, name, and id. I do not believe transforms are processed or accepted on this.

Thanks,
Braden

I liked your out of the box thinking. AFAIK Transforms are supported in Identity Profile and Provisioning forms, no where else. So, I don’t think this will work.

Thanks
Krish

For any future people.
This has been resolved via the afterModifyConnector Rule, and using Powershell scripts to assign the user to the groups