REST API to fetch incident updated in last 5 min

Priyanshu
Giga Expert

Hello all,

can anyone help me with the script of rest API to fetch the list of incident updated in last 5 min.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Community Alums
Not applicable
10 REPLIES 10

I am getting error

 

{
"error": {
"detail": "Error Parsing input streamJSONObject[\"request\"] not found.",
"message": "Exception while reading request"
},
"status": "failure"
}

 

https://dev72524.service-now.com/api/now/table/incident?sysparm_query=sys_updated_onRELATIVELE%40minute%40ago%405

asifnoor
Kilo Patron

You can try like this, but it gives incidents updated in  last 15 minutes. We don't have a filter for 5 minutes. 

https://your-instance.service-now.com/api/now/table/incident?sysparm_query=sys_updated_on%3Ejavascript%3Ags.beginningOfLast15Minutes()&sysparm_limit=10

Yes for 15 minutes and last minutes filter is there, is there any way to achieve this through scripted API

Where are you displaying these incidents? In another app or somewhere in SN itself?

You can fetch the results and can filter further and fetch only the incidents which are last 5 minutes. 

Mark the comment as a correct answer/helpful if it helps.

 

I need to display these incident in other app