3

How do we retrieve the incidents for the last 1 hour through rest api ? The following filter doesn't seem to work and returns every incident

https://instance.service-now.com/api/now/table/incident?sys_parrn_query=active=true^sys_created_onBETWEENjavascript:gs.dateGenerate('2018-02-28','05:00:00')@javascript:gs.dateGenerate('2018-02-28','06:00:00')&sysparm_fields=number,priority,short_description,caller_id,description,description,sys_id,severity,sys_created_on,sys_updated_on

Maddy
  • 125
  • 2
  • 8

2 Answers2

2

Glad that helped..

As mentioned in the comments fixing the typo, sys_parrn_query to sysparm_queryshould fix your issue.

A couple of useful links related to Filters:

Use a URL query to filter a list result Filters and breadcrumbs

Rafay
  • 30,950
  • 5
  • 68
  • 101
0

Try this query:

https://instance.service-now.com/api/now/table/incident?sysparm_query=active=true^sys_created_onBETWEENjavascript:gs.dateGenerate('2018-02-28','05:00:00')@javascript:gs.dateGenerate('2018-02-28','06:00:00')&sysparm_fields=number,priority,short_description,caller_id,description,description,sys_id,severity,sys_created_on,sys_updated_on
CJ Dennis
  • 4,226
  • 2
  • 40
  • 69
Bhuvan
  • 1
  • Can you explain why this solves the problem? Although it may solve it, explaining *why* or *how* it does so is often more important. Thank you! – Max von Hippel Jul 18 '18 at 04:48
  • @Bhuvan You should provide some explanation here! What is changed? What is the reason of the problem? – arashka Jul 18 '18 at 05:13