Click HERE to see how Saviynt Intelligence is transforming the industry. |
12/20/2023 03:00 AM - last edited on 12/20/2023 03:27 AM by Sunil
Hello,
Getting below error while running the provisioning job.
If I am trying offboarding branches(BR) or Consultant (CO)
JSON:
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://test.service-now.com/api/x_abfs_saviynt_int/saviynt_request ",
"httpMethod": "POST",
"httpParams":"{\"process_type\":\"${if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==1){'Contingent Worker Onboarding'} else if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==0) {'Contingent Worker Offboarding'} else if(user.statuskey==1 && user.customproperty51=='BR') {'FT/PT Onboarding – Branches'} else if(user.statuskey==0 && user.customproperty51=='BR') {'FT/PT Offboarding – Branches'} else if(user.statuskey==1 && user.customproperty51=='CO' && location=='Remote'){'FT Onboarding – Back Office – Remote'} else if(user.statuskey==1 && user.customproperty51=='CO' && location=='Hybrid'){'FT Onboarding – Back Office – Hybrid'} else if(user.statuskey==0 && user.customproperty51=='CO' && location=='Remote'){'FT Offboarding – Back Office – Remote'} else if(user.statuskey==0 && user.customproperty51=='CO' && location=='Hybrid'){'FT Offboarding – Back Office – Hybrid'} else {'Undefined'}}\",\"employee_data\":{\"Name\":\"${user.firstname}\",\"title\": \"${user.title}\",\"dept\": \"${user.departmentname}\",\"${user.statuskey==1 ? 'hire_date' : 'separation_date' }\" : \"${user.statuskey==1 ? user.startdate : user.enddate}\" , \"email\": \"${user.email}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"open",
"OPEN",
"Open"
],
"successResponses": {
"200": "User Created Successfuly.",
"201": "User Created Successfuly.",
"204": "User Created Successfuly.",
"205": "User Created Successfuly."
},
"unsuccessResponses": {
"400": "Create Account Failed.",
"401": "Create Account Failed.",
"403": "Create Account is not Authorized.",
"404": "Create Account Resource Not Found.",
"405": "Create Account Failed.",
"406": "Create Account Request Not Acceptable.",
"415": "Create Account Unsupported.",
"500": "Create Account Failed.",
"502": "Create Account Failed."
}
}
]
}
ERROR:
{"call1":{"headers":null,"message":{"error":{"message":"Missing parameter","detail":"There's not an existing user with the sent email."},"status":"failure"},"statusCode":400,"description":null,"status":"Failed"}}
Any assistance would be greatly appreciated.
[This message has been edited by moderator to disable URL]
Solved! Go to Solution.
12/21/2023 08:11 PM
Hello @DebashisPanda,
Is it working in postman ? can you provide the screeshot for the same, as it indicate email parameter is missing or incorrect. You might want to check the source of your user data to ensure that the email addresses are being correctly included in your requests.
You may also try to use to pass the empty string, if service now allows to create the account without email.
{
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://test.service-now.com/api/x_abfs_saviynt_int/saviynt_request ",
"httpMethod": "POST",
"httpParams": "{\"process_type\":\"${if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==1){'Contingent Worker Onboarding'} else if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==0) {'Contingent Worker Offboarding'} else if(user.statuskey==1 && user.customproperty51=='BR') {'FT/PT Onboarding – Branches'} else if(user.statuskey==0 && user.customproperty51=='BR') {'FT/PT Offboarding – Branches'} else if(user.statuskey==1 && user.customproperty51=='CO' && location=='Remote'){'FT Onboarding – Back Office – Remote'} else if(user.statuskey==1 && user.customproperty51=='CO' && location=='Hybrid'){'FT Onboarding – Back Office – Hybrid'} else if(user.statuskey==0 && user.customproperty51=='CO' && location=='Remote'){'FT Offboarding – Back Office – Remote'} else if(user.statuskey==0 && user.customproperty51=='CO' && location=='Hybrid'){'FT Offboarding – Back Office – Hybrid'} else {'Undefined'}}\",\"employee_data\":{\"Name\":\"${user.firstname}\",\"title\": \"${user.title}\",\"dept\": \"${user.departmentname}\",\"${user.statuskey==1 ? 'hire_date' : 'separation_date' }\" : \"${user.statuskey==1 ? user.startdate : user.enddate}\" , \"email\": \"${user.email != null ? user.email : ''}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"open",
"OPEN",
"Open"
],
"successResponses": {
"200": "User Created Successfully.",
"201": "User Created Successfully.",
"204": "User Created Successfully.",
"205": "User Created Successfully."
},
"unsuccessResponses": {
"400": "Create Account Failed.",
"401": "Create Account Failed.",
"403": "Create Account is not Authorized.",
"404": "Create Account Resource Not Found.",
"405": "Create Account Failed.",
"406": "Create Account Request Not Acceptable.",
"415": "Create Account Unsupported.",
"500": "Create Account Failed.",
"502": "Create Account Failed."
}
}
]
}
Thanks.
12/22/2023 01:46 AM - last edited on 12/22/2023 02:28 AM by Sunil
Thanks for the reply I got the solution and it is working now.
Correct JSON
{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://removed.service-now.com/api/x_abfs_saviynt_int/saviynt_request ",
"httpMethod": "POST",
"httpParams":"{\"process_type\":\"${if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==1){'Contingent Worker Onboarding'} else if(user.employeeType!=null && user.employeeType=='Consultant' && user.statuskey==0) {'Contingent Worker Offboarding'} else if(user.statuskey==1 && user.customproperty51=='BR') {'FT/PT Onboarding – Branches'} else if(user.statuskey==0 && user.customproperty51=='BR') {'FT/PT Offboarding – Branches'} else if(user.statuskey==1 && user.customproperty51=='CO' && user.location=='Remote'){'FT Onboarding – Back Office – Remote'} else if(user.statuskey==1 && user.customproperty51=='CO' && user.location=='Hybrid'){'FT Onboarding – Back Office – Hybrid'} else if(user.statuskey==0 && user.customproperty51=='CO' && user.location=='Remote'){'FT Offboarding – Back Office – Remote'} else if(user.statuskey==0 && user.customproperty51=='CO' && user.location=='Hybrid'){'FT Offboarding – Back Office – Hybrid'} else {'Undefined'}}\",\"employee_data\":{\"Name\":\"${user.firstname}\",\"title\":\"${user.title}\",\"dept\": \"${user.departmentname}\",\"${user.statuskey==1 ? 'hire_date' :'separation_date'}\" :\"${user.statuskey==1 ? user.startdate : user.enddate}\" , \"email\": \"${user.email}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"ticketStatusPath": "result.state",
"ticketStatusValue": [
"open",
"OPEN",
"Open"
],
"successResponses": {
"200": "User Created Successfuly.",
"201": "User Created Successfuly.",
"204": "User Created Successfuly.",
"205": "User Created Successfuly."
},
"unsuccessResponses": {
"400": "Create Account Failed.",
"401": "Create Account Failed.",
"403": "Create Account is not Authorized.",
"404": "Create Account Resource Not Found.",
"405": "Create Account Failed.",
"406": "Create Account Request Not Acceptable.",
"415": "Create Account Unsupported.",
"500": "Create Account Failed.",
"502": "Create Account Failed."
}
}
]
}
[This message has been edited by moderator to mask URL]