08/23/2023 09:21 AM
Hi !
I am working on implementing a Service Desk connection with ServiceNow to open requests from Saviynt. In my use case, it consists in 2 API calls :
I have a few concerns where I'd need your help :
PFA logs, CreateTicketJSON and response from second call are attached.
Solved! Go to Solution.
08/23/2023 10:09 AM
@adriencosson , yes we can do multiple call in createticketjson.
However, I see in your API response of first call , the RITM number which will be dynamic is itself coming as a key. But still try once as below to retrieve it in call2:
${response.createRequest.message.result[0].number}
Also please try call1 with a static value for expression ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task?.requestedBy).customproperty26} . This to isolate the issue.
08/23/2023 11:07 AM
Hello @nimitdave ,
Thanks for the information,
Actually the response I gave is from second call (how I expect it to be).
For first call response I retrieve the REQ id using the ${response.createRequest.message.result.number} path which should be fine.
I did try the same without the ${com.saviynt.ecm.identitywarehouse.domain.Users.get(task?.requestedBy).customproperty26} (which I definitely can replace by ${requestedBy.customproperty26} but I am still getting the same error :
I also tried to empty the ticketidPath and ticketStatusPath from first API call and only have them in the second call (where it is expected) and it is failing.
08/24/2023 02:28 AM
Hi @adriencosson
When there are multiple calls in CreateTicketJSON, the ticketidPath needs to be placed outside the call.
Please check the below sample and provide the valid traversing path to the TicketID.
{
"ticketidPath": "call2.message.<Path to the TicketID>",
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "<<>>",
"httpMethod": "POST",
"httpParams": "{<<>>}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
},
{
"name": "call2",
"connection": "userAuth",
"url": "${response.call1.headers.Location}",
"httpMethod": "GET",
"httpParams": "{}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}
If you still face any issues please share the below :
1. Confirmation that the call2 is invoked and you have a valid response.
2. Response of call2
Thank you
Vedanth B.K
08/24/2023 06:27 AM
Hello @Vedanth_BK ,
Thanks for your help, we managed to make it with a single API Call that provides the Request Number and the task goes to "Pending Provision" state.
Now we want to achieve the following :
One of the attributes must be the Requestor's customproperty26. Following the documentation, we tried the same but none of the below were successful :
https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm#top
Thanks for helping.
09/13/2023 03:31 AM
Hello @Vedanth_BK ,
For my latest reply, I was able to make it using the below variable :
For using multiple API Calls, I have tried the attached JSON but it is not working.
Note that I also attached the JSON response where I would need to use a wildcard but it retrieves me a "null" value a RITM Number.
Can you help me finding the appropriate path ? Below are not working :
Thanks !