I want a rest api query to fetch first 5(recent) incidents from service now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2016 11:27 PM
I want a rest api query to fetch first 5(recent) incidents from service now
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 10:58 PM
Hi Vaidehi
add ORDERBYDESCsys_created_on in sysparm_query.generate the code and in the generated code change the limit to 5.
//Below code is servicenow generated code from rest API
var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://dev15501.service-now.com/api/now/table/incident?sysparm_query=ORDERBYDESCsys_created_on&sysp...
request.setHttpMethod('GET');
//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';
request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");
var response = request.execute();
gs.log(response.getBody());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2021 06:57 AM
This is a correct answer I think someone should Mark it 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-31-2020 05:21 AM
@haresh its very use full for me but i want approved incident number fetch can pls help me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2020 03:42 PM
What do you mean by approved incident number? Generally there is no approvals in incidnet process. PLease send details about "approved incidents".
-Harsh