Double Creation of prefix on update accounts

So i am most like am going to take dummy moment on this but when i run this rule for create it adds the values as needed. However, when someone goes to update this account from a request the display name is adding the prefix again. Does anyone know what the check check is to not that happen and only on create add the prefix.

image

{
    "id": "02ac3343-4f90-4de4-ab29-4f84b09083d8",
    "name": "Non-Human Account Create V1",
    "type": "static",
    "attributes": {
        "fn": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "u_account_name",
                "sourceName": "SNOW Non-Human Service Accounts Source"
            }
        },
        "accountTypeValue": {
            "attributes": {
                "attributeName": "u_service_account_type",
                "sourceName": "SNOW Non-Human Service Accounts Source"
            },
            "type": "accountAttribute"
        },
        "value": "#if($accountTypeValue=='Bot')SVCRPA_${fn}#{else}SVC_${fn}#end"
    },
    "internal": false
}

Hi @VBsupport

As it’s a static primitive transformation which is being used here. Currently the double prefixName is coming due to the returned name from the accountTypeValue which is not “Bot” in your case.

So the retuned value itself is coming as SVC_SPNonHumantest03 so post transformation value is coming as SVC_SVC_SPNonHumantest03 as per the configured transformed.

Kindly check the identity displayName from the source before applying the transformation.

For more information kindly find the link here : - Static | SailPoint Developer Community

I hope this might help.

Thanks,
Prashant

I ended up adding another condition that only applies to create however i cannot figure out the last } } to end the code do you see wht what i missing at the end

{
    "id": "",
    "name": "Non-Human Acount Create V2",
    "type": "static",
    "attributes": {
        "fn": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "u_account_name",
                "sourceName": "SNOW Non-Human Service Accounts Source"
            }
        }
		{,
        "accountTypeValue": {
            "attributes": {
                "attributeName": "u_service_account_type",
                "sourceName": "VSNOW Non-Human Service Accounts Source"
            },
            "type": "accountAttribute"
        },
		
    },
	
{,
        "accountTypeValue01": {
            "attributes": {
                "attributeName": "requestAction",
                "sourceName": "SNOW Non-Human Service Accounts Source"
            },
            "type": "accountAttribute"
        },
		"value": "#if($accountTypeValue=='Bot'|| $accountTypeValue01 =='Account Provisioning' )SVCRPA_${fn}#{elseif]($accountTypeValue01 =='Account Provisioning')SVC_${fn}#{else}#end"
		},

Just fixed the typo which you requested for. Logic part as it is.

{
    "type": "static",
    "attributes": {
        "fn":{
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "SNOW Non-Human Service Accounts Source",
                "attributeName": "u_account_name"
            }
        },
        "accountTypeValue":{
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "SNOW Non-Human Service Accounts Source",
                "attributeName": "u_service_account_type"
            }
        },
        "accountTypeValue01":{
            "type": "accountAttribute",
            "attributes": {
                "sourceName": "SNOW Non-Human Service Accounts Source",
                "attributeName": "requestAction"
            }
        }
        ,
        "value": "#if($accountTypeValue01 == 'Bot' || $accountTypeValue01 == 'Account Provisioning' )SVCRPA_$fn#elseif($accountTypeValue01 == 'Account Provisioning')SVC_${fn}#{else}#end"
    },
    "name": "Non-Human Acount Create V2"
}
1 Like

your better bet would be to add a condition in your if/else to first check whether the $fn value already starts with svc, and if it does, skip adding it:

"value": "#if($accountTypeValue=='Bot' && $fn.substring(0,5) <> "SVCRPA")SVCRPA_$fn#elseif($fn.substring(0,2) <> "SVC")SVC_$fn#{else}$fn#end"

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.