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

ServiceNow TicketStatusJSON

jezzanuena
Regular Contributor II
Regular Contributor II

Hi! Our environment got upgraded from 23.10 to 24.5, since then the TicketStatusJSON is not working. Below are the JSONs I am using. I can successfully create the ticket. But when the admin closed the ticket in ServiceNow level, the tasks are not getting completed after running the provisioning job. No logs found. The tasks were not even getting updated when we check it in the Pending Tasks module. Help, please? I also tried recreating the ConnectionJSON but didn't work.

TicketStatusJSON:

{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://domainname.service-now.com/api/now/table/sc_request?sysparm_query=number=${ticketID}&sysparm...",
"httpMethod": "GET",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketStatusPath": "result[0].state",
"ticketStatusValue": [
"Closed Complete",
"Close Incomplete",
"Closed Skipped"
],
"successResponses":
{"statusCode":[200,201]}

}
]
}

CreateTicketJSON:

{
"call": [
{
"name": "call1",
"connection": "userAuth",
"url": "https://domainname.service-now.com/api/mkr/ssm_integration/create_request",
"httpMethod": "POST",
"httpParams": "{\"application\": \"${endpoint.customproperty6}\",\"requested_for\":\"${user.email}\",\"short_description\":\"'Test Only'\",\"account\": \"${user.username}\",\"request_type\": \"${requestAccessAttributes?.get('reqtype')}\",\"description\": \"${'User Name: ' +user.displayname+ '\\\\n EID: ' +user.username+ '\\\\n User Email: ' +user.email+ '\\\\n \\\\nRequest Details: \\\\n' +allEntitlementsValues}\"}}",
"httpHeaders": {
"Authorization": "${access_token}"
},
"httpContentType": "application/json",
"ticketidPath": "result.requestNumber",
"successResponses": {
"statusCode": [
200,
201
]
}
}
]
}

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

Please share postman screenshot and curl command [Refer https://codingnconcepts.com/postman/how-to-generate-curl-command-from-postman/ ]
⚠️‼️‼️Do not upload any attachments that contain sensitive information, such as IP Addresses, URLs, Company/Employee Names, Email Addresses, etc.‼️‼️⚠️


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

Hi @rushikeshvartak  please see the attached for the postman response for ticketStatusJSON call Here are the logs:

jezzanuena_0-1720519697529.png

Here is the Security System config:

jezzanuena_1-1720519733724.png

Here is the Create ticket respone:

jezzanuena_2-1720519858500.png

This integration is configured to create a REQUEST, once approved, it will create a SCTASK under the RITM. When the task is marked as complete, it also close the RITM then REQ.

Hi @jezzanuena is the connection name configured under connectionJSON is userAuth?

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

jezzanuena
Regular Contributor II
Regular Contributor II

Hi @naveenss  thank you for checking in on this issue. Yes. I made sure that the connection name matches to the JSON above:

{
"authentications": {
"userAuth": {
"authType": "oauth2",
"url": "https://domainname.service-now.com/oauth_token.do",
"httpMethod": "POST",
"httpParams": {
"grant_type": "password",
"client_id": "client_id",
"client_secret": "client_secret",
"username": "serviceaccount",
"password": "password"
},
"httpHeaders": {
"Content-Type": "application/x-www-form-urlencoded"
},
"httpContentType": "application/x-www-form-urlencoded",
"retryFailureStatusCode": [
403,
401,
500
],
"authError": [
"InvalidAuthenticationToken",
"AuthenticationFailed",
"Authentication_MissingOrMalformed",
"Authentication_ExpiredToken"
],
"errorPath": "error.code",
"maxRefreshTryCount": 5,
"tokenResponsePath": "access_token",
"tokenType": "Bearer",
"accessToken": "Bearer <token>"
}
}
}

Need ticketStatusJSON from saviynt


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

@jezzanuena is this issue resolved?

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

jezzanuena
Regular Contributor II
Regular Contributor II

Hi! Yes. This is resolved. User error though. 🙂 There was a requestid number in the advancedconfig. 😅