Error in Create REST connector Ticket JSON

Ash_saviynt1
New Contributor
New Contributor

To integrate a custom ticketing system for revocation of attestation, we are developing a REST connector
For the creation of tickets, we have configured the connection parameters (ConnectionJSON and CreateTicketJSON) as well as the security system, endpoint, and WSretry job.
However, every time we revoke access by generating a new task for the WSretry job, we receive the following error:

 

Ash_saviynt1_0-1695668812932.png

postman response:

Ash_saviynt1_1-1695668863708.png

 

CreateTicketJSON 

================

{
"call": [{
"name": "call1",
"connection": "userAuth",
"url": "https://servicedeskqa.xxxxxxxxx",
"httpMethod": "POST",
"httpParams": "{\"shortDescription\": \"saviyant testing new 2\",\"description\": \"Testingnew1\", \"application\": \"WMP\",\"userUID\": \"100xxxxx\"}",
"httpHeaders": {
"Authorization": "${accessToken}"},
"httpContentType": "application/json",
"successResponses": {
"statusCode": [
200,
201
]
}
}]
}

========================

 

securitysystem config:

Ash_saviynt1_2-1695669090131.png

 

 

 

9 REPLIES 9

SB
Saviynt Employee
Saviynt Employee

This appears to be an issue with the JSON as the application is not able to get the Ticket ID. So either the call is not successful or the response mapping is incorrect. 

You can refer the below document for JSON references and update your JSON accordingly.

REST - https://docs.saviyntcloud.com/bundle/REST-v23x/page/Content/Developers-Handbook.htm

 


Regards,
Sahil

SumathiSomala
Regular Contributor III
Regular Contributor III

Hi @Ash_saviynt1 , 

Which type of ticket you are creating in Servicenow? 

Regards,
Sumathi Somala

Ash_saviynt1
New Contributor
New Contributor

@SumathiSomala  cherwell ticketing system

SumathiSomala
Regular Contributor III
Regular Contributor III

@Ash_saviynt1 I have shared the sample createticketjson. please change the JSON as per your requirement.

{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://XXXXXXXX.service-now.com/api/now/table/sc_request",
"httpMethod": "POST",
"httpParams": "{\"opened_by\":\"${requestor}\",\"requested_for\":\"${user.username}\",\"assignment_group\":\"Application Support\",\"short_description\":\"This request has been created from Saviynt Security Manager IAM system\",\"application\":\"${task.endpoint?.displayName}\"}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.number",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

 

Let me know if it helps.

Regards,
Sumathi Somala

@SumathiSomala  Using above json I got same error. I just tried using OAuth2 authentication and got same result

 

test connectionjson:

 

{"authentications":{"userAuth":{"authType":"oauth2","httpHeaders":{"contentType":"application/application/json"},"authError":["InvalidAuthenticationToken","AuthenticationFailed","FAILURE","INVALID_SESSION_ID"],"url":"https://servicedeskqa.xxxxxxx","httpMethod":"POST","httpContentType":"application/json","errorPath":"errors.type","maxRefreshTryCount":5,"tokenResponsePath":"sessionId","tokenType":"Bearer","authHeaderName":"Authorization","accessToken":"eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiYXBpX1Nhdml5bnQiLCJjbGllbnRfaWQiOiI5ZTJlYjdiOC0xOWMyLTRiM2ItOTYxMi02YzQyNDFkOTY0ZmUiLCJpZGVudCI6IntcImFwcGxpY2F0aW9uX3R5cGVcIjpcIkJyb3dzZXJDbGllbnRcIixcImF1dGhlbnRpY2F0aW9uX3R5cGVcIjpcIlRyZWJ1Y2hldFwiLFwidXNlcl9pZFwiOlwiYXBpX1Nhdml5bnRcIixcInNlY19ncnBcIjpcIjkzMzczNDAyZGE1OTYzNWJhOWU2MTY0Y2Y4OTM2NDc3NGEzYTJiZWJiMVwiLFwicGVyc29uYVwiOlwiOTM2NWE0NTJjNzBkNjlhNTcyNGJiMDQ2NTQ5ZTQ2NDg0ODNiODVmZGZjXCIsXCJ0b2tlblwiOm51bGwsXCJkZWZfdHlwZV9pZFwiOlwiOTMzODIxNmIzYzU0OWI3NTYwN2NmNTQ2NjdhNGU2N2QxZjY0NGQ5ZmVkXCIsXCJidXNfb2JfaWRcIjpcIjk0OWMwODBhZDAzZWExZGUxYjA2MDQ0Mzk2YmEwZGY1NmE5YTUxNTQ5MFwiLFwibW9kdWxlX2NvZGVcIjpcIlJFU1RBUElcIixcImxpY19wcm9kX2NvZGVcIjpcIkNTRFwiLFwibG9nZ2VkX2luX3Nlc3Npb25cIjpcImhzbHhFcnhPYW1iQzhpS3RNYlB5RkhZb2J2S3BMNzQzXCIsXCJ2aWV3X2lkXCI6XCJcIixcInNwZWNpZmljX2N1bHR1cmVcIjpcIlwiLFwiY3VycmVudF9jdWx0dXJlXCI6XCJlbi1VU1wiLFwiYWxsX2N1bHR1cmVzXCI6ZmFsc2V9IiwibmJmIjE2OTYyNDgxNTgsImlzcyI6Imh0dHBzOi8vY2hlcndlbGwuY29tIiwiYXVkIjoiOWUyZWI3YjgtMTljMi00YjNiLTk2MTItNmM0MjQxZDk2NGZlIn0.ujDcNE_XdqGIcHakIb4doQNasVNQNjgpIjNpyUqdqU4","retryFailureStatusCode":[]}}}

 

 

create ticket json:

 

{
"call": [{
"name": "call1",
"connection": "acctAuth",
"url": " https://servicedeskqaxxxxxxx",
"httpMethod": "POST",
"httpParams": "{\"busObId\": \"6dd53665c0c24cab86870a21cf6434ae\",\"persist\": true,,\"fields\": [{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:9xx2d98844b7a93c76e03885b889\",\"name\": \"AccessRequestConverted\",\"value\": \"1\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870axx6434ae,FI:945474eb20xxxfe85a47fcab3b2601b98e8bc4\",\"name\": \"ApprovalCompleted\",\"value\": \"1\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:9454498xx335ad051d4e6481235dfd03cb9a02\",\"name\": \"ApprovalRequired\",\"value\": \"0\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:93670bdf8abexxf92b1f490a90c7b7d684222e13\",\"name\": \"Source\",\"value\": \"API Integration\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:93734aaff77b1xxfcfd1d4b4aba1b0af895f25788\",\"name\": \"CustomerDisplayName\",\"value\": \"Savyint Integration\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:93e8ea93fxx5118255419690a50ef2d56f910c\",\"name\": \"ShortDescription\",\"value\": \"WMP - Terminate Access, Login ID: fmax, UID:1000xxx\"},{ \"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:252b836fc72c4149915053ca1131d138\",\"name\": \"Description\",\"value\": \"WMP - Terminate Access, Login ID: fmax, UID:1000xxx\r\n\r\nSavyint Access Revocation\"},{ \"dirty\": true, \"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:936725cd10c735d1dd8c5b4cd4969cb0bd833655f4\", \"name\": \"Service\", \"value\": \"Access\" },{ \"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:9476bd17daee7b44d2f2894fadb2ed6e2b53d52f9c\", \"name\": \"CorporateEntity\",\"value\": \"AG\"},{\"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:9e0b434034e94781ab29598150f388aa\",\"name\": \"Category\",\"value\": \"WMP\"},{ \"dirty\": true, \"fieldId\": \"BO:6dd53665c0c24cab8687xxx1cf6434ae,FI:1163fda7e6a44f40bb94d2b47cc58f46\", \"name\": \"Subcategory\", \"value\": \"Termination\"},{ \"dirty\": true, \"fieldId\": \"BO:6dd53665c0c24cab86870a21cxxxx,FI:83c36313e97b4e6b9028aff3b401b71c\", \"name\": \"Priority\",\"value\": \"2\"},{ \"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24xxxxa21cf6434ae,FI:ae05c132527e48bd95d063c445622df7\",\"name\": \"Impact\", \"value\": \"Should Have\"}, { \"dirty\": true,\"fieldId\": \"BO:6dd53665c0c24cab86870a21cf6434ae,FI:29d741aae8bf461f8aafa3c9eb4dc822\", \"name\": \"Urgency\", \"value\": \"Expedite\"}]}",
"httpHeaders": {
"Authorization": "${accessToken}"
},
"httpContentType": "application/json",
"ticketidPath": "result.busObPublicId",
"successResponses": {
"statusCode": [
200,
201
]
}
}]
}

 

working postman output:

 

Ash_saviynt1_0-1696247080564.png

 

 

 

 

SB
Saviynt Employee
Saviynt Employee

Can you define the the path as below and try

"ticketidPath": "busObPublicId",


Regards,
Sahil

@SB I'm getting the same null pointer exception

SB
Saviynt Employee
Saviynt Employee

Can you update ConfigJSON param in the REST connection with value {"showLogs":true}.
This will enable additional logging and may help to identify the cause.

Can you share the log for 1 task. In case sharing the log on forums is not possible. I would suggest opening a ticket with Saviynt support.


Regards,
Sahil

@SB  creating a ticket and uploading logs there. Thank you!