Distinguish name - AD - IdentityNow issue

Hi,
I need to convert lastname to uppercase in distinguish name transform for AD provisioning. For this I wrote the below transform but this is not working. Users are getting created with the below DN :-

CN=$(firstname) $(lastname)$(uniqueCounter),OU=CyberArkTest,OU=Users

{
“attributes”:{
“cloudMaxSize”:“200”,
“cloudMaxUniqueChecks”:“50”,
“cloudRequired”:“true”
},
“isRequired”:false,
“multi”:false,
“name”:“distinguishedName”,
“transform”:{
“attributes”:{
“firstName”:{
“attributes”:{
“name”:“firstname”
},
“type”:“identityAttribute”
},
“lastname”:{
“attributes”:{
“input”:{
“attributes”:{
“name”:“lastname”
},
“type”:“identityAttribute”
}
},
“type”:“upper”
},
“patterns”:[
“CN=$firstname $lastname$(uniqueCounter),OU=CyberArkTest,OU=Users”
],
“sourceCheck”:true
},
“type”:“usernameGenerator”
},
“type”:“string”
}

Kindly let me know what is wrong in this transform. Why $firstname and $lastname is not getting replaced with the actual firstname and lastname?

Regards,
Mahesh

Hi @mpoddar123,
In transform you are getting “firstName” as the firstname identity Attribute. You need to use the same in pattern.
“patterns”:[
“CN=$firstName $lastname$(uniqueCounter),OU=CyberArkTest,OU=Users”
],
Also add a pattern which doesn’t contain uniquecounter. Below is a working example:

​​​​{
                "attributes": {
                    "cloudMaxSize": "200",
                    "cloudMaxUniqueChecks": "50",
                    "cloudRequired": "true"
                },
                "isRequired": false,
                "multi": false,
                "name": "distinguishedName",
                "transform": {
                    "type": "usernameGenerator",
                    "attributes": {
                        "sourceCheck": true,
                        "patterns": [
                            "CN=$firstName$lastName,OU=CyberArkTest,OU=Users",
                            "CN=$firstName$lastName$(uniqueCounter),OU=CyberArkTest,OU=Users"
                        ],
                        "firstName": {
                            "type": "identityAttribute",
                            "attributes": {
                                "name": "firstname"
                            }
                        },
                        "lastName": {
                            "attributes": {
                                "input": {
                                    "attributes": {
                                        "name": "lastname"
                                    },
                                    "type": "identityAttribute"
                                }
                            },
                            "type": "upper"
                        }
                    }
                },
                "type": "string"
            }