- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2020 07:26 AM
Hi All,
I wanted to get last 10 records in incident table through background script.
Please help me out here.
Thanks & Regards,
sAtyA.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2021 11:26 PM
HI,
Please find the below script for getting last 10 records.
var incRecord = new GlideRecord('incident');
incRecord.orderByDesc('sys_created_on');
incRecord.setLimit(10);
incRecord.query();
while(incRecord.next()){
gs.info("Incident Record: " + incRecord.number);
}
Please mark this helpful if your query is resolved
Best Regards
Himanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2025 03:07 AM
var gr = new GlideRecord('incident');
gr.orderBy('sys_created_on');
gr.setLimit(10);
gr.query();
while(gr.next()){
gs.info("Incident Record: " + gr.number);
}