Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

how to invoke only one api call based on conditional check

iam01
Regular Contributor
Regular Contributor

I want to trigger one call based on the conditional check. i tried few options but stuck with error. However what i observed is connection name is mandatory.

 

{
    "accountIdPath": "accountName",
    "responseColsToPropsMap": {
        "displayName": "#CONST#${user.displayname}~#~char"
    },
    "call": [
        {
            "name": "call1",
            "connection": "${if(user.customproperty12 == 'RehireBefore90'){'acctAuth'}else {''}}",
            "url": "https://xx.net/Saviynt/PS/ExecutePSScript",
            "httpMethod": "POST",
            "httpParams": "{\"script\":\"C:\\\\\\\\Scripts\\\\\\\\rehireuser1.ps1 -useremail \\\"${user.email} \"}",
            "httpHeaders": {
                "Authorization": "${access_token}"
            },
            "httpContentType": "application/x-www-form-urlencoded",
            "successResponses": {
                "response[0].CompletedSuccessfully": [
                    "True"
                ]
            }
        },
        {
            "call": [
                {
                    "name": "call2",
                    "connection": "${if(user.customproperty12 == 'RehireAfter90'){'acctAuth'}else {''}}",
                    "url": "https://xx/Saviynt/PS/ExecutePSScript",
                    "httpMethod": "POST",
                    "httpParams": "{\"script\":\"C:\\\\\\\\Scripts\\\\\\\\CreateRemoteUserMailBox1.ps1 -sam \\\"${user.systemUserName}\\\" -upn \\\"${user.email}\\\" \"}",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpContentType": "application/x-www-form-urlencoded",
                    "successResponses": {
                        "response[0].EmailAddressPolicyEnabled": [
                            "True"
                        ]
                    }
                }
            ]
        }
    ]
}

 

ERROR :

"call1":{"message":"Ambiguous method overloading for method java.lang.String#<init>.\nCannot resolve which method to invoke for [null] due to overlapping prototypes between:\n\t[class [B]\n\t[class [C]\n\t[class java.lang.String]","status":"Failed"}}



2 REPLIES 2

iam01
Regular Contributor
Regular Contributor

syntax error. resolved

Can you share updated JSON


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.