Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
08/06/2024 10:56 PM
Hi All,
We are facing this issue when we are trying to provision serviceNow account. The provisioning fails intermittently with following error:
"message":{"error":{"message":"Operation Failed","detail":"Error during insert of sys_user (${user.firstname} ${user.lastname})"},"status":"failure"},"statusCode":403,"description":null,"status":"Failed"}}
This error is observed if user already exist in ServiceNow, but this is not the case. We have verified that user we are trying to provision is not present in serviceNow.
We observed that when we pass the inactive manager name or manager account not prsent the servicenow then this error is occured.
Following is the createAccount Json:
{
"accountIdPath": "call1.message.result.sys_id",
"call": [
{
"name": "call1",
"connection": "acctAuth",
"url": "https://xyz/api/now/table/sys_user",
"httpMethod": "POST",
"httpParams": "{\"name\":\"${user.username}\",\"location\":\"${user.location}\",\"email\":\"${user.email}\",\"first_name\":\"${user.firstname}\",\"last_name\":\"${user.lastname}\",\"employee_number\":\"${user.username}\",\"user_name\":\"${user.systemUserName}\",\"u_employeeid\":\"${user.username}\",\"department\":\"${user.departmentname}\",\"manager\":\"${managerAccount.accountID}\",\"u_position\":\"${user.jobcodedesc}\",\"u_discovery_source\":\"Saviynt\",\"active\":\"true\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201,
202
]
},
"unsuccessResponses": {
"statusCode": [
400,
401,
403,
412,
422
]
}
}
]
}
Could u please suggest the manager syntax - how we need to pass manager syntax even if the user manager account is inactive or not prsent in servicenow.
08/07/2024 12:08 AM
try below
\"manager\":\"${managerAccount==null?'':managerAccount.accountID}\"
\"manager\":\"${if(managerAccount!=null){managerAccount.accountID} else{''}}\"
08/07/2024 12:33 AM
Thanks, it's working now
08/07/2024 01:39 AM
@ankitalande If my response resolved your issue then please click Accept As Solution and give Kudos.