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

REST - Update user JSON issue

saimeghana
Regular Contributor II
Regular Contributor II

Hi Team,

We are using the below query to update the CP60 as same as email by using few condition, but we see connection was successful, but updates were not pushed to the user.

"httpParams": "{\"username\":\"${user?.username}\",\"customproperty60\":\"${(user?.entity == 'WW SuccessFactors' && user?.customproperty60==null && user?.customproperty3==null && user?.email!=null) ? user?.email}\"}"

Please help us to resolve this issue.

Thanks,

Sai Meghana

27 REPLIES 27

NM
Honored Contributor II
Honored Contributor II

Hi @saimeghana was the task picked..?

saimeghana
Regular Contributor II
Regular Contributor II

No, it didn't created the task.

NM
Honored Contributor II
Honored Contributor II

Create a task via user update rule then only connection will come into picture.

saimeghana
Regular Contributor II
Regular Contributor II

Created the user update rule, to trigger the task when attribute is updated via API.

And created the job to run this sav to sav connection, it didn't created the task.

  • Does rule is matching condition.
  • did you validated logs. ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

saimeghana
Regular Contributor II
Regular Contributor II

Hi

Now task got created and completed successful, but the query is not checking the condition which we gave the condition to filter the users to update the cp60.

"httpParams": "{\"username\":\"${user?.username}\",\"customproperty60\":\"${(user?.customproperty60==null && user?.customproperty3==null && user?.email!=null) ? user?.email}\"}"

Thanks,

Sai Meghana

  • Share logs ?
  • What is current value of cp60 of user ?
  • Does user have email ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi Rushikesh,

  • What is current value of cp60 of user ? -- Null
  • Does user have email ? -- yes

Thanks,

Sai Meghana

"httpParams": "{\"username\":\"${user?.username}\",\"customproperty60\":\"${(user?.customproperty60 == null && user?.customproperty3 == null && user?.email != null) ? user?.email : ''}\"}"


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Tried with the above query still it's same not consider the condition updating for all users

Share logs during task processing


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi Rushikesh,

We are using the detective job to run the user update rule, and it will create the task.

please find the below logs for reference

"2024-08-28T08:22:46.768+00:00","ecm","services.UsersService","http-nio-8080-exec-7-zn59q","DEBUG","saving params for report [controller:restfulv5, customproperty60:, action:updateUser, username:SAVTEST.SAPUT003]"
"2024-08-28T08:22:46.773+00:00","ecm","log.LogUserLoginsService","http-nio-8080-exec-7-zn59q","DEBUG","UserLogins login for loginkey=930014 userid=7152comment=token"
"2024-08-28T08:22:46.796+00:00","ecm","ws.Restfulv5Controller","http-nio-8080-exec-7-zn59q","DEBUG","allow inactive manager config: null"
"2024-08-28T08:22:46.796+00:00","ecm","ws.Restfulv5Controller","http-nio-8080-exec-7-zn59q","DEBUG","setting validateagainstpolicy to N"
"2024-08-28T08:22:46.805+00:00","ecm","utility.CustomPreprocessUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","Process the Validation using Custom Jar Logic"
"2024-08-28T08:22:46.810+00:00","ecm","utility.CustomPreprocessUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","Class Name: "
"2024-08-28T08:22:46.810+00:00","ecm","utility.CustomPreprocessUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","Method Name: "
"2024-08-28T08:22:46.810+00:00","ecm","utility.CustomPreprocessUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","Processed User Data after Custom Validation [isValid:true]"
"2024-08-28T08:22:46.824+00:00","ecm","changeaction.UserChangeActionService","http-nio-8080-exec-7-zn59q","DEBUG","Update Fields for User History Tabs : []"
"2024-08-28T08:22:46.844+00:00","ecm","changeaction.UserChangeActionService","http-nio-8080-exec-7-zn59q","DEBUG","inlineeval = true"
"2024-08-28T08:22:46.861+00:00","ecm","ws.Restfulv5Controller","http-nio-8080-exec-7-zn59q","DEBUG","User updated successfully"
"2024-08-28T08:22:46.861+00:00","ecm","services.SaviyntCommonUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","contentType - text/json"
"2024-08-28T08:22:46.863+00:00","ecm","services.SaviyntCommonUtilityService","http-nio-8080-exec-7-zn59q","DEBUG","contentTypeFromConfig - application/json"
"2024-08-28T08:22:46.867+00:00","ecm","log.LogUserLoginsService","http-nio-8080-exec-7-zn59q","DEBUG","UserLogins logout for loginkey=930014"

Thanks,

Sai Meghana

Please share full json as logs shows 

"2024-08-28T08:22:46.861+00:00","ecm","ws.Restfulv5Controller","http-nio-8080-exec-7-zn59q","DEBUG","User updated successfully"


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Hi Rushikesh,

Issue: update user task created but updates are not pushed to user.

Pls find the attached logs and jsons

{
"actions": {
"Update Login": {
"call": [
{
"name": "updateusercp",
"connection": "userAuth",
"url": "https://abc-test.saviyntcloud.com/ECM/api/v5/updateUser",
"httpMethod": "POST",
"httpContentType": "application/json",
"httpParams": "{\"username\":\"${user?.username}\" ${if(user?.entity == 'abc' && user?.customproperty60 == null && user?.customproperty3 == null && user?.email != null && user?.statuskey == '1'){',\"customproperty60\":\"'+user?.email+'\"'} else {''}}}",
"httpHeaders": {
"Authorization": "${access_token}",
"Content-Type": "application/json"
},
"successResponses":
{
"message": "User Updated Successfully",
"statusCode": "200,201"
}
}
]
}
}
}

 

{
  "actions": {
    "Update Login": {
      "call": [
        {
          "name": "Update Login",
          "connection": "userAuth",
          "url": "https://abc-test.saviyntcloud.com/ECM/api/v5/updateUser",
          "httpMethod": "POST",
          "httpContentType": "application/json",
          "httpParams": "{\"username\":\"${user?.username}\" ${if(user?.entity == 'abc' && user?.customproperty60 == null && user?.customproperty3 == null && user?.email != null && user?.statuskey == '1'){',\"customproperty60\":\"'+user?.email+'\"'} else {''}}}",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Content-Type": "application/json"
          },
          "successResponses": {
            "message": "User Updated Successfully",
            "statusCode": "200,201"
          }
        }
      ]
    }
  }
}

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Tried with above json, tasks are not getting completed ran the advance query to complete 1 task but still task not completed.

{"Update Login":{"headers":null,"message":{"errorCode":"0","message":" User Updated Successfully"},"statusCode":200,"description":null,"status":"Failed"}}

Thanks,

Sai Meghana

Share latest logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

rushikeshvartak
All-Star
All-Star
  • Does connection is successful?
  • did you ran wsretry for selected task ?

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Yes, connection was successful.

tasks are not created.

Validate logs


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

stalluri
Valued Contributor
Valued Contributor

@saimeghana 

 

{
  "actions": {
    "Update Login": {
      "call": [
        {
          "name": "Update Login",
          "connection": "userAuth",
          "url": "https://abc-test.saviyntcloud.com/ECM/api/v5/updateUser",
          "httpMethod": "POST",
          "httpContentType": "application/json",
          "httpParams": "{\"username\":\"${user?.username}\" ${if(user?.entity == 'abc' && user?.customproperty60 == null && user?.customproperty3 == null && user?.email != null && user?.statuskey == '1'){',\"customproperty60\":\"'+user?.email+'\"'} else {''}}}",
          "httpHeaders": {
            "Authorization": "${access_token}",
            "Content-Type": "application/json"
          },
          "successResponses": {
                "statusCode": [
                    201,
                    200
                ]
            },
            "unsuccessResponses": {
                "statusCode": [
                    500,
                    401,
                    400,
                    403,
                    404,
                    409,
                    502
                ]
            }
        }
      ]
    }
  }
}

 

 Can you try the above Json.
Based on the error you are getting success response but unable to handle the response.


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

saimeghana
Regular Contributor II
Regular Contributor II

Hi Sam Talluri,

Tried the above json and it's same it's not updated in user identity. In logs we can see successfully updated and status as 200.

We are using the import user JSON in same connection, in import user Json if we map the values, it's updating correctly.

Please find the logs attached.

Thanks,

Sai Meghana

saimeghana
Regular Contributor II
Regular Contributor II

Is "propertytosearch" field is mandatory in the update user json?

Yes its mandatory

This method updates a specific "user" record in SSM, based on the input parameter username of the relevant user.

All the input parameters it requires are attributes which could be updated for the relevant user record. The attributes which are supplied with valid values as input to the method, will get updated, if the operation is successfully executed.

The Authorization must have Bearer followed by Token.

Mandatory params:

username

OR

propertytosearch

Note - If both params are passed, propertytosearch will take precedence.

https://documenter.getpostman.com/view/36233838/2sA3XMi33N#22d037e9-1957-4aa3-b757-6124bab574fe


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Okay, we don't have the 'propertytosearch' value is it required in this json?

"httpParams": "{\"username\":\"${user?.username}\" ${if(user?.entity == 'abc' && user?.customproperty60 == null && user?.customproperty3 == null && user?.email != null && user?.statuskey == '1'){',\"customproperty60\":\"'+user?.email+'\"'} else {''}}}",

 

Thanks,

Sai Meghana

Add and validate


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Amit_Malik
Valued Contributor II
Valued Contributor II

It is not mandatory. Can you just update a cp with some hard coded value. 

If that works then we know something wrong with conditions. If that also doesn't work means something outside httpparams

Kind Regards,
Amit Malik
If this helped you move forward, please click on the "Kudos" button.
If this answers your query, please select "Accept As Solution".