Tickets get created in ServiceNow, but the Ticket Number does not show up in AutoSys
search cancel

Tickets get created in ServiceNow, but the Ticket Number does not show up in AutoSys

book

Article ID: 440946

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Symptoms

  • AutoSys integration with ServiceNow is configured, and tickets are successfully created in ServiceNow.
  • However, the ticket number does not appear in AutoSys when viewing job run details (e.g., via autorep -dJ).

Cause

AutoSys is not parsing the JSON Path being returned from ServiceNow. The default parsing we have are in the default notification template for helpdesk:


HELPDESK_TICKET_NUMBER=jsonpath:$.result.number  ## number
HELPDESK_TICKET_ID=jsonpath:$.result.sys_id                ## id 
HELPDESK_TICKET_STATE=jsonpath:$.result.state           ## state

But these may not be the exact ones that your ServiceNow instance returns to AutoSys (maybe customization was done)

So we need to identify the correct JSON Path to determine why AutoSys is not capturing the ticket number, enable debug on the scheduler to view the raw API response:

  1. Edit the configuration file (e.g., $AUTOUSER/config.$AUTOSERV).
  2. Set ISDBGACTIV=LIGHT,HEAVY,JOB.
  3. Locate the PID of the event_demon process and send a HUP signal: kill -HUP <pid>  (pause and resume Scheduler Service for Windows)
  4. Reproduce the issue and check the event_demon log (e.g., $AUTOUSER/out/event_demon.$AUTOSERV) for the callRestAPI() response.

05/14/2026 09:46:10.0145] 224749 139891551696640 callRestAPI(): http response code = 200[05/14/2026 09:46:10.0146] 224749 139891551696640 callRestAPI(): response = [{"status":"success","incident":{"sys_id":"#########","number":"INC#######","active":"true","state":"New","caller_id":"Service Account","affected_user":"Service Account","configuration_item":"Example CI","symptom":"Job Failure","priority":"5 - Planning","short_description":"Autosys Job Failure: Example Job Name","correlation_id":"","correlation_display":"","link":"https://example.com/ays?sys_id=######id=ays_ticket&table=incident"}}]
[05/14/2026 09:46:10.0148] 224749 139891551696640 L:2 svcnow.cpp 245 HDESK_createTicket Response [{"status":"success","incident":{"sys_id":"#########","number":"INC#######","active":"true","state":"New","caller_id":"Service Account","affected_user":"Service Account","configuration_item":"Example CI","symptom":"Job Failure","priority":"5 - Planning","short_description":"Autosys Job Failure: Example Job Name","correlation_id":"","correlation_display":"","link":"https://example.com/ays?sys_id=######id=ays_ticket&table=incident"}}] rc [1] apiRetCode [0] http code [200]

 

The JSON Path shows that it is not in:  jsonpath:$.result.number   but more like  jsonpath:$.incident.number 

NOTE: stop the debug by reverting to ISDBGACTIV=OFF and repeat step 3 and 4 above

Resolution

Based on the response structure identified above, update the JSON paths in the notification template via JIL.

  • Delete the existing notification template via JIL first
  • Update the template file with the correct JSON paths matching your ServiceNow response. Because the jsonpath above has  incident number in:      incident.number   we can use:    

HELPDESK_TICKET_NUMBER=jsonpath:$.incident.number
HELPDESK_TICKET_ID=jsonpath:$.incident.sys_id
HELPDESK_TICKET_STATE=jsonpath:$.incident.state

  • Insert the updated template using JIL.
  • Test the Job Failure use case and then verify that autorep -dJ now correctly displays the ServiceNow ticket number.