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

Prevent task from changing to pending provision state for createticketjson when result is null

Huddos
Regular Contributor
Regular Contributor

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
]
}
}
]
}

 

1 REPLY 1

rushikeshvartak
All-Star
All-Star
  • This is managed internally by code.

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