Manager Update Transform Error

Hello all,

We have hit a wall and need a little push to the finish line on this. Hopefully the great things i have heard within this community will be able to help as we are almost done but for this last min requirement. The code below is run in the identity profile on manager. When the user is onboarded if they do not have a manager yet in the field we put no manager and then get updated when added. How ever when the user is disabled in the system their manager gets removed and we need to keep that manager still in the field in IDN though the source removed it.

A simple static or conditional transforms by themself works fine but smash them together as it should I cannot get the field to display ā€œManager on first loadā€ it keeps throwing out error

{
    "id": "9ef708cf-0a8b-433d-930c-8ad30ba8095b",
    "name": "Manager  Transform",
    "type": "static",
    "attributes": {
        "Manager": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "Manager ID",
                            "sourceName": "Manager Test Pull"
                        },
                        "type": "accountAttribute"
                    },
                    "No Manager"
                ]
            },
            "type": "firstValid"
        },
        "status": {
            "attributes": {
                "values": [
                    {
                        "attributes": {
                            "attributeName": "Status",
                            "sourceName": "Manager Test Pull"
                        },
                        "type": "accountAttribute"
                    },
                    "NONE"
                ]
            },
            "type": "firstValid"
        },
        "value": "#if($status == 'active')$Manager#elseif($status != 'inactive')$oldValue#else#end"
    },
    "internal": false
}

The Manager stays when the user goes inactive and is removed with the above code . The problem comes when a new person comes in without a manager it is erroring out and completing the profile build. What i need it to do is display ā€œNo Managerā€ first when the account is built and then update that field when its added later. after that the other code would kick in from the LCS of the user

You need to define the $oldValue in ā€œvalueā€.

State whatā€™s the error message you received.

1 Like

What is your error message ?

In your expression

ā€œvalueā€: ā€œ#if($status == ā€˜activeā€™)$Manager#elseif($status != ā€˜inactiveā€™)$oldValue#else#endā€

where do you define $oldValue ?

In the inactive user case wich value do you want to display ?

The only thing that jumps out is the ā€œElseā€ statement:
#if($status == ā€˜activeā€™)$Manager#elseif($status != ā€˜inactiveā€™)$oldValue#else#end

In the case the ā€œManager Test Pullā€ account is not mapped or the status does not match ā€œactiveā€ or ā€œinactiveā€, it would likely error out.

1 Like

I did some rework and have it all working but for getting the ā€œNo managerā€ to display when there is none when user is active. I will always show the current or past manager when they are active or inactive which is what is expected. Right now it comes in blank when a new user comes in and has no manager yet which needs to be displayed as ā€œNo managerā€

ā€œnameā€: ā€œManager Name Reworkā€,
ā€œtypeā€: ā€œstaticā€,
ā€œattributesā€: {
ā€œignoreErrorsā€: ā€œtrueā€,
ā€œvalueā€: ā€œ#if($status==ā€˜inactiveā€™)manager#{elseif}($manager != "NM")$manager#{end}ā€,
ā€œstatusā€: {
ā€œtypeā€: ā€œaccountAttributeā€,
ā€œattributesā€: {
ā€œattributeNameā€: ā€œStatusā€,
ā€œsourceNameā€: ā€œManager Test Pullā€
}
},
ā€œmanagerā€: {
ā€œtypeā€: ā€œfirstValidā€,
ā€œattributesā€: {
ā€œvaluesā€: [
{
ā€œtypeā€: ā€œruleā€,
ā€œattributesā€: {
ā€œattributeNameā€: ā€œmanageridā€,
ā€œnameā€: ā€œCloud Services Deployment Utilityā€,
ā€œoperationā€: ā€œgetReferenceIdentityAttributeā€,
ā€œuidā€: ā€œmanagerā€
},
ā€œignoreErrorsā€: ā€œtrueā€
},
{
ā€œtypeā€: ā€œstaticā€,
ā€œattributesā€: {
ā€œvalueā€: ā€œNMā€
}
}
]
},
ā€œignoreErrorsā€: ā€œtrueā€
}
},
ā€œinternalā€: false

Helle @VBsupport,

i update your transform if you can test it :

{
    "name": "Manager Name Rework",
    "type": "static",
    "attributes": {
        "ignoreErrors": "true",
        "value": "#if($status==ā€˜inactiveā€™)manager#{else}$manager#{end}",
        "status": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "Status",
                "sourceName": "Manager Test Pull"
            }
        },
        "manager": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "type": "rule",
                        "attributes": {
                            "attributeName": "managerid",
                            "name": "Cloud Services Deployment Utility",
                            "operation": "getReferenceIdentityAttribute",
                            "uid": "manager"
                        },
                        "ignoreErrors": "true"
                    },
                    {
                        "type": "static",
                        "attributes": {
                            "value": "NM"
                        }
                    }
                ]
            },
            "ignoreErrors": "true"
        }
    },
    "internal": false
}

this is throwing a error as below.
The code i had before is working and for inactive and null values however all i need to do is be able to add the wording " No Manager" when the user is active and does not have a manager

Use case

  1. When a user becomes ā€œinactiveā€, they need to keep the manager they have while the source has removed its manager value.
  2. When a user is onboarded, they may not have a manager so when they are active but have no manager the blank field need to display ā€œNo Managerā€ until it is updated at the source with a manager which then would replace the ā€œno managerā€ with the new correct value

Error:
There was an exception while calculating the value for this attribute. Error rendering template: #if($status==ā€˜inactiveā€™)manager#{else}$manager#{end}

Take a look at the links provided below, which may be helpful to you. First Valid | SailPoint Developer Community

I donā€™t see any issues with @baoussounda . I have just removed all the ā€œignoreErrorsā€ as itā€™s default value is true.

{
    "name": "Manager Name Rework",
    "type": "static",
    "attributes": {
        "ignoreErrors": "true",
        "value": "#if($status=='inactive')manager#{else}$manager#end",
        "status": {
            "type": "accountAttribute",
            "attributes": {
                "attributeName": "Status",
                "sourceName": "Manager Test Pull"
            }
        },
        "manager": {
            "type": "firstValid",
            "attributes": {
                "values": [
                    {
                        "type": "rule",
                        "attributes": {
                            "attributeName": "managerid",
                            "name": "Cloud Services Deployment Utility",
                            "operation": "getReferenceIdentityAttribute",
                            "uid": "manager"
                        }
                    },
                    "No Manager"
                ]
            }
        }
    },
    "internal": false
}
1 Like

Thank you everyone and GOKUL on the 3rd eye. It is awesome to have such a great group of people helping for the greater good of each other. Please feel free to reach out if you need help as well

1 Like

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