The CreatorCon Call for Content is officially open! Get started here.

Rest api call for *todays* incident tickets

jonmuni
Kilo Contributor

Hi guys,

Im trying to construct a rest api call ( using the rest explorer ) to query for all "new" tickets created "today" with a specific "Origination method".

Can anyone help?

I'm very new to this so please be gentle!

thanks!

Jon

1 ACCEPTED SOLUTION

Shiva Thomas
Kilo Sage

Hi Jon,



Go to the incident.list or task.list and use the filter to define your query.


Execute it to preview the result.


Now you can do a left click on the filter breadcrumb to copy the query.


2017-07-11 14_46_32-Incidents _ ServiceNow.png


In the REST API Explorer, paste this in the field sysparm_query


2017-07-11 14_48_59-REST API Explorer _ ServiceNow.png


View solution in original post

5 REPLIES 5

Shiva Thomas
Kilo Sage

Hi Jon,



Go to the incident.list or task.list and use the filter to define your query.


Execute it to preview the result.


Now you can do a left click on the filter breadcrumb to copy the query.


2017-07-11 14_46_32-Incidents _ ServiceNow.png


In the REST API Explorer, paste this in the field sysparm_query


2017-07-11 14_48_59-REST API Explorer _ ServiceNow.png


Hi guys,



both worked perfectly, thanks!



Now, when querying for the user all I get is:



u_requested_for": {
  "link": "https://my-siteservice-now.com/api/now/table/sys_user/d64b8f8e4fe0be80e7fae57d0210c796",
  "value": "d64b8f8e4fe0be80e7fae57d0210c796"



How can I make this into either a user name or email address??



Thanks again for all of your help.



Jon


Set sysparm_display_value to true on REST API Explorer and it will return back the display value on your table either name or email.



Thanks


Ali


Hi Alikutty,



Even better, in the REST API Explorer, set the sysparm_display_value field to "all".


It will display the sys_id, the link, AND the display value.