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

JsonParseException in createTicketJSON

varunpuri
Regular Contributor
Regular Contributor

Hi,

We have configured createTicketJSON in the REST connection object and are using this as the ServiceDesk connection for disconnected applications. I am attaching the JSON here for your reference.

Request gets submitted in Service Now and a provisioning task is getting successfully generated in Saviynt. However, when we run the provisioning job, following error gets displayed in the logs :

quartzScheduler_Worker-3] ERROR rest.RestProvisioningService - Error in createNewServiceTicketcom.fasterxml.jackson.core.JsonParseException: Unexpected character ('c' (code 99)): was expecting comma to separate Object entries"
"2023-10-10T13:32:05.745+00:00","ecm-worker","","","","2023-10-10T13:32:04.779841137Z stdout F at 

I have validated the JSON in JSON validator and the validation is successful. Additionally, the payload is also getting printed with all the correct values as shown below :

{"variables":"{"comments":"Complete this request to create account for ABC in TestDisconnectedApplicationEp", "trm":"1234","env":"development"}","requestDetails":"{"requested_for":"1111","requested_by":"1111","request_id":"12345","existing_request":"YES"}"}

What might be the issue here ?

Best Regards,
Varun

10 REPLIES 10

Saathvik
All-Star
All-Star

What is the status of pending task?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

varunpuri
Regular Contributor
Regular Contributor

Hello @Saathvik,

When we view the task, we see this :
varunpuri_0-1696967563404.png
Best Regards,
Varun

varunpuri
Regular Contributor
Regular Contributor

Hi, 

Any inputs please, for this issue ?

Best Regards,
Varun

Please share postman response

Logo
{
  "call": [
    {
      "name": "call1",
      "connection": "SNOW",
      "url": "https://URL.service-now.com/api/x_saviy_iga/sav_api",
      "httpMethod": "POST",
      "httpParams": "{\"variables\":\"{\"comments\":\"${if((task.tasktype==1 || task.tasktype==3) && (allEntitlementsValues!=null && !allEntitlementsValues.isEmpty() && allEntitlementsValues!='')){'Complete this request to create account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application along with access '+allEntitlementsValues}else if((task.tasktype==1 || task.tasktype==3) && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Complete this request to create account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName}else if(task.tasktype==2 && (allEntitlementsValues==null || allEntitlementsValues.isEmpty() || allEntitlementsValues=='')){'Complete this request to remove account for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName}else if(task.tasktype==2 && task.source=='REQUEST'){'Complete this request to remove access for ' +user.firstname+' ' +user.lastname +' in ' +task.endpoint?.displayName +' application. Following accesses need to be removed : '+allEntitlementsValues}}\", \"trm\":\"${task.endpoint?.customproperty1}\",\"env\":\"development\"}\",\"requestDetails\":\"{\"requested_for\":\"${user.username}\",\"requested_by\":\"${requestor}\",\"request_id\":\"${if(task.requestKey!=null){task.requestKey?.processinstanceid?.substring(task.requestKey?.processinstanceid?.indexOf('.') + 1, task.requestKey?.processinstanceid?.length())}else if(task.requestKey==null){'NO_REQUEST_AVAILABLE'}}\",\"existing_request\":\"YES\"}\"}",
"httpHeaders": {
        "Authorization": "${access_token}"
      },
"httpContentType": "application/json",
      "ticketidPath": "result.number",
      "successResponses": {
        "statusCode": [
          200,
          201
        ]
      }
    }
  ]
}

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

09
New Contributor III
New Contributor III

@varunpuri  were you able to resolve it?

varunpuri
Regular Contributor
Regular Contributor

@09 , yes, we were able to resolve it. Attaching the correct payload.

Best Regards,
Varun 

09
New Contributor III
New Contributor III

@varunpuri  could you please validate below

 

09_0-1701929352820.png

 

 

09_1-1701929385960.png

 

09
New Contributor III
New Contributor III

just for testing purpose am using below json in createticketJson. am getting the same error message(ticket Null).

 

JSON:

{ "call": [ { "name": "call1", "connection": "login", "url": "https://removed/api/users/3 ", "httpMethod": "POST", "httpHeaders": { "Authorization": "${access_token}" }, "httpContentType": "application/json", "ticketidPath": "responseText.id" , "successResponses": {
"statusCode": [
200,
201
]
}} ] }

i have tried below as well


"ticketidPath": "responseText.id"
"ticketidPath": "id"
"ticketidPath": "response.id"

 

 

API RESPONSE:

{
    "id""284",
    "createdAt""2023-12-07T05:57:55.440Z"
}
[This message has been edited by moderator to disable url hyperlink]

varunpuri
Regular Contributor
Regular Contributor

Hello @09 ,

Try this : "ticketidPath": "ticket.id"

Best Regards,
Varun

@09 

Try 

"ticketidPath": "result.id"

Also check your connection name in JSON it should match with connection name used in connectionJSON

 

Regards,
Sumathi Somala

If this reply answered your question, please Accept As Solution and give Kudos.