Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Multiple API call for CreateTicketJSON for ServiceNow as a Ticketing System

gabe_ung
New Contributor III
New Contributor III

Hi Team,

I'm trying to configure SNow as a ticketing system that require two api calls.  First call to create the order and the second call to submit the order.

I wrote the JSON using the example from the Developers Handbook (saviyntcloud.com)  Example 4 of the Ticket JSON section of the documentation.

I am unable to get the ticket number to  submit_order api.

gabe_ung_0-1694176904312.png

Attached is the JSON I used.

Would appreciate some assistance on this.  Thank you.

Regards,

Gabe

 

 

2 REPLIES 2

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @gabe_ung,

Can you please try with the below json ,

{
"ticketidPath":"call2.result.request_number",
"call":[
{
"name":"call1",
"connection":"userAuth",
"url":"https://example.service-now.com/api/sn_sc/servicecatalog/items/3a9428614f0de2045116afee0310c71a/orde...",
"httpMethod":"POST",
"httpParams":"{\"sysparm_quantity\":\"1\",\"variables\":{\"SomeoneElse\":\"Someone Else\",\"RequestedFor\":\"${userAccount.get('ServiceNow').accountID}\",\"sysparm_requested_for\":\"${userAccount.get('ServiceNow').accountID}\",\"UserAccountManagement_workflow\":\"pre_delete\",\"TellUsAbout\":\"TEST value from API\"}}",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json",
"unsuccessResponses":{
"message":""
}
},
{
"name":"call2",
"connection":"userAuth",
"url":"https://example.service-now.com/api/sn_sc/servicecatalog/cart/submit_order",
"httpMethod":"POST",
"httpParams":"{}",
"httpHeaders":{
"Authorization":"${access_token}"
},
"httpContentType":"application/json"
}
]
}

Thanks,
If you find the above response useful, Kindly Mark it as "Accept As Solution".

Hi @sudeshjaiswal,

Thank you for replying.

I think I found the issue, when I hard code the user sys_id I am able to generate a ticket and submit the order.

This means the way I am trying to get the user sys_id (${userAccount.get('ServiceNow').accountID}) is incorrect - which I will have to look into.