REAST API call for latest ticket for a given assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 05:53 AM
Hi guys,
I am automating ticket creation for badge scans and am looking to create a REST api call to query for the incident number with a user name variable ( powershell )
Essentially, what happens is the ticket gets created and I then want to send back a response with the user name (which is variable) and inc number.
Can anyone help?
thanks!
jon
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 06:02 AM
Hi Jon,
Using the table API, you'll get a response back with the details of the new record. I invite you to use the REST API Explorer to test it out.
Getting Started with REST - ServiceNow Wiki
REST API Explorer - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 06:10 AM
Hi Chuck,
I am using the api explorer but am at a loss. I have the response but not the latest ticket created for a given user for "today".
What am I missing?
Cheers!
Jon

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 06:14 AM
I thought you were using REST to create a record?
the ticket gets created and I then want to send back a response with the user name (which is variable) and inc number
That information is passed back as part of the REST response when you create a record. If you want the display values (e.g. user name) then add this to the URI when the record is created (using the POST).
sysparm_display_value=true
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2017 06:18 AM
Hi Chuck,
I am, this is the second phase which is to display a confirmation with the ticket number and "requested for" attribute.
here is the url:
mysite.service-now.com/api/now/table/incident?sysparm_query=state%3D0%5Esys_created_onONToday%40javascript%3Ags.daysAgoStart(0)%40javascript%3Ags.daysAgoEnd(0)&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_suppress_pagination_header=&sysparm_fields=number%2Cu_requested_for&sysparm_limit=1&sysparm_view=
Jon