Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/20/2024 12:26 AM
Hi,
I want to prevent the New Account Status from changing from New to Pending Provision when createticketjson returns a null value instead of a REQ by ServiceNow. ServiceNow seems to just return {} if an API call fails. For each call I have no way to determine if it succeeds other than "connection": "${response.call1.message.result[0].size() == 0 ? '' : 'userAuth'}", which seems to work for call2 only.
I need if ticketidPath = null, leave task status as New.
{
"ticketidPath": "call3.message.result.request_number",
"cartidPath": "call2.message.result.cart_id",
"usersysidPath": "call1.message.result.sys_id",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://xxx.service-now.com/api/now/table/sys_user?sysparm_query=user_name%3D${user.username}&syspar...",
"httpMethod": "GET",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
403,
409,
412
]
}
},
{
"name": "call2",
"connection": "${response.call1.message.result[0].size() == 0 ? '' : 'userAuth'}",
"url": "${(task.tasktype==3 || task.tasktype==6) ? 'https://xxx.service-now.com/api/sn_sc/servicecatalog/items/498cb9f3e0e206000f720ccf56a5bb52/order_no...' : 'https://xxx.service-now.com/api/sn_sc/servicecatalog/items/0c9883e4db8d79504775be32f3961954/order_no...'}",
"httpMethod": "POST",
"httpParams": "{\"sysparm_quantity\":\"1\",\"variables\":{\"SomeoneElse\":\"Someone Else\",\"RequestedFor\":\"${response.call1.message.result[0].sys_id}\",\"sysparm_requested_for\":\"${response.call1.message.result[0].sys_id}\",\"action\":\"${(task.tasktype==3 || task.tasktype==6) ?'Request access':''}\",\"Software_PC_Serial\":\"${(task.tasktype==3 || task.tasktype==6) ? 'NA' : ''}\",\"Short Description\":\"${(task.tasktype==3 || task.tasktype==6) ? 'HR21 Kiosk':''}\",\"TellUsAbout\":\"${(task.tasktype==3 || task.tasktype==6) ?'Automatically raised by Saviynt Joiner workflow' : 'Automatically raised by Saviynt Leaver workflow'}\",\"UserAccountManagement_workflow\":\"${(task.tasktype==3 || task.tasktype==6) ? '' : 'pre_delete'}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"unsuccessResponses": {
"message": ""
}
},
{
"name": "call3",
"connection": "${response.call1.message.result[0].size() == 0 ? '' : 'userAuth'}",
"url": "https://xxx.service-now.com/api/sn_sc/servicecatalog/cart/submit_order",
"httpMethod": "POST",
"httpParams": "",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200
]
},
"unsuccessResponses": {
"statusCode": [
500,
403,
409,
412
]
}
}
]
}