Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Update user Task is not getting completed in Sav4Sav rest connection

Balaji_S
Visitor
Visitor

Hello,

We are trying to update user status using Sav4Sav.

We have configured the below JSON to process the update user tasks. Task is getting stuck in pending tasks though it completes the operation of updating the user. 

UpdateUserJson:

{
"actions": {
"Update Login": {
"call": [
{
"name": "Update Login",
"callCondition": "${user?.customproperty1 == 'Active'}",
"connection": "acctAuth",
"url": "https://xxxx/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpParams": "{\"username\":\"${user.username}\",\"statuskey\":\"1\",\"termdate\":\"\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": [
{
"message": "User Updated Successfully",
"status": ["success"],
"statusCode": [
200,
201
]
}
]
},
{
"name": "Update Login",
"callCondition": "${user?.customproperty1 == 'Terminate'}",
"connection": "acctAuth",
"url": "https://xxxx/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpParams": "{\"username\":\"${user.username}\",\"statuskey\":\"0\",\"termdate\":\"${new java.text.SimpleDateFormat('yyyy-MM-dd').format(new Date())}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": [
{
"message": "User Updated Successfully",
"status": ["success"],
"statusCode": [
200,
201
]
}
]
}
]
}
}
}

2 REPLIES 2

stalluri
Valued Contributor
Valued Contributor

@Balaji_S 

{
    "actions": {
        "Update Login": {
            "call": [
                {
                    "name": "Update Login",
                    "connection": "${user?.customproperty1 == 'Active'?'acctAuth':''}",
                    "url": "https://xxxx/ECM/api/v5/updateUser",
                    "httpMethod": "POST",
                    "httpParams": "{\"username\":\"${user.username}\",\"statuskey\":\"1\",\"termdate\":\"\"}",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpContentType": "application/json",
                    "successResponses": [
                        {
                            "message": "User Updated Successfully",
                            "status": [
                                "success"
                            ],
                            "statusCode": [
                                200,
                                201
                            ]
                        }
                    ]
                },
                {
                    "name": "Update Login",
                    "connection": "${user?.customproperty1 == 'Active'?'Terminate':''}",
                    "url": "https://xxxx/ECM/api/v5/updateUser",
                    "httpMethod": "POST",
                    "httpParams": "{\"username\":\"${user.username}\",\"statuskey\":\"0\",\"termdate\":\"${new java.text.SimpleDateFormat('yyyy-MM-dd').format(new Date())}\"}",
                    "httpHeaders": {
                        "Authorization": "${access_token}"
                    },
                    "httpContentType": "application/json",
                    "successResponses": [
                        {
                            "message": "User Updated Successfully",
                            "status": [
                                "success"
                            ],
                            "statusCode": [
                                200,
                                201
                            ]
                        }
                    ]
                }
            ]
        }
    }
}


Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

Balaji_S
Visitor
Visitor

We found the issue. In response from saviynt api we are getting 

"message": " User Updated Successfully"

So when we change the same in below it completed the tasks

"successResponses": [
                        {
                            "message": " User Updated Successfully",
                            "status": [
                                "success"
                            ],
                            "statusCode": [
                                200,
                                201
                            ]
                        }
                    ]