07/25/2023 04:59 AM - edited 07/25/2023 05:00 AM
Issues :For an update operation from Saviynt to application we have an requirement to read properties from Accounts customproperties. For which all the target values have been reconciled to Accounts Customproperties. However when we trigger the UpdateAccountJson the task is failing and unable to resolve the Account specific values. It works fine from postman and when we hardcode the account values in Json. Have tried both the syntax Account.accountproperties or userAccount.get('endpoint').accountsproperties. PFA attached JSON and let me know if any additional syntax to be followed to fetch the account properties for Update task to work.
For example :For testing purpose 'id' is hardcoded in hardcoded in Json hence doesn't appear in the error value whereas all other account read values have failed
Error: message":{"code":"MODIFYING_IMMUTABLE_FIELDS","message":"Account Type,Initials,Locale,Status cannot be missed or modified."},"statusCode":400,"description":null,"status":"Failed"}}
Solved! Go to Solution.
07/25/2023 05:02 AM - edited 07/25/2023 05:02 AM
Hi @Anu ,
when you're doing userAccount.get('endpointname')?.customproperty1. is your endpoint account is in "active" state and not in manually provisioned state?
07/25/2023 05:04 AM
@Anu also, there was an error in your JSON. I have modified it. Can you please try with the below JSON?
{
"accountIdPath": "call1.message.userId",
"dateFormat": "yyyy-MM-dd'T'HH:mm:ssXXX",
"responseColsToPropsMap": {},
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxxxxxx/api/rest/v6/users/${account?.accountID}",
"httpMethod": "PUT",
"httpParams": "{\"email\":\"${user.email}\",\"accountType\":\"${account.accounttype}\",\"firstName\":\"${user.firstname}\",\"lastName\":\"${user.lastname}\",\"initials\":\"${userAccount.get('endpointname').customproperty7}\",\"locale\":\"${account.customproperty6}\",\"status\":\"${account.customproperty11}\",\"company\":\"${user.entity}\",\"phone\":\"${user.phonenumber}\",\"title\":\"${user.title}\",\"id\":\"xxxxxxxx\"}",
"httpHeaders": {
"content-Type": "application/json",
"Accept": "application/json",
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
204
]
}
}
]
}
07/25/2023 05:08 AM
@naveenss Thanks for the response. we should fetch the account properties using Account.accountproperties or userAccount.get('endpoint').accountsproperties ?
07/25/2023 05:12 AM
Hi @Anu ,
Use userAccount.get('endpointname')?.customproperty to get account properties.
07/25/2023 05:19 AM
${userAccount.get('EP-A').accountID} to get account properties of a different app/endpoinnt account for the same user.
${arsTasks.account.customproperty41} or ${task?.accountKey?.customproperty41} to get cp41 of the same account for which json is getting invoked.
07/25/2023 06:23 AM
Hi Nimit, Updated the Json with syntax ${task?.accountKey?.customproperty41} to get account values as its the same account for which the JSON is getting invoked. However still the update account task is failing and unable to resolve the account properties
07/25/2023 06:27 AM
@Anu , What error you are getting in the logs or task comment?
07/25/2023 08:42 AM - edited 07/25/2023 08:42 AM
Please find the error below
[quartzScheduler_Worker-16] ERROR rest.RestProvisioningService - Call response: {"code":"MODIFYING_IMMUTABLE_FIELDS","message":"Account Type,Initials,Locale,Status cannot be missed or modified."}
[quartzScheduler_Worker-16] ERROR rest.RestProvisioningService - callResponseMap:
07/25/2023 09:34 AM
@Anu from the error it says, you're modifying an attribute which is not supposed to be updated. Can you confirm if the above attributes "Account Type,Initials,Locale,Status" are allowed to be updated from postman?
07/25/2023 09:45 AM - edited 07/25/2023 10:15 AM
@naveenss As stated in the Problem statement we are able to update from PostMan and also able to update when we hardcode the account values in Json. Usecase: when we want to update the firstname of the User from Saviynt ,target API expects actual target values(Account Type,Initials,Locale,Status) also to be passed for the user .Hence using the reconciliation we have stored the Target user details in account custom properties. So when an update task trigger for user firstname change ,its expected that we also read/pass user values from account properties for these columns Account Type, Initials, Locale, Status. If we send all the column values from user profile it works however when we try to pass from account properties its failing
07/25/2023 11:43 PM
@Anu : check for logs as below:
2023-07-26 11:59:06,700 [quartzScheduler_Worker-15] DEBUG rest.RestProvisioningService - Inside pullObjectsByRest
2023-07-26 11:59:06,700 [quartzScheduler_Worker-15] DEBUG rest.RestUtilService - Got showLogs = true
2023-07-26 11:59:06,701 [quartzScheduler_Worker-15] DEBUG rest.RestProvisioningService - Calling Webservice Url - http://<domainname>/ECM/api/v5/updateAccount with httpParams - [securitysystem:SolveSpace, endpoint:SolveSpace, name:EMP0013, customproperty3:UAT, 460361:desc, status:1]
Looks like one of the expression is not get evaluated and because of which whole json is not getting evaluated.
Also , I assume that the account is already having the custom properties and account type values set before the update account request submission.
07/26/2023 12:43 AM
@nimitdave Thanks for the response. All the account custom properties have been set and validated . Showlog is already set to true still unable to locate the Updateaccount specific trace as you mentioned in the logs.
09/05/2023 09:23 AM
@Anu is this issue resolved?
09/05/2023 09:42 AM
This issue was resolved.we where able to get the account details during Update using \"accountType\":\"${account.accounttype}\"