Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/25/2024 11:03 AM
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
]
}
]
}
]
}
}
}
Solved! Go to Solution.
09/25/2024 11:27 AM
{
"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
]
}
]
}
]
}
}
}
09/25/2024 11:36 AM
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
]
}
]