How to display last 3 months incident records using script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2022 11:12 PM
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 12:30 AM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 01:05 AM
yes i know:) , i asked Rajesh where he wants to display the incident records?
what is the original requirement?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 03:33 AM
Hi @rajesh47
Please try below script
var inc = new GlideRecord("incident");
inc.addEncodedQuery("sys_created_onONLast 3 months@javascript:gs.beginningOfLast3Months()@javascript:gs.endOfLast3Months()");
inc.orderByDesc("sys_created_on");
inc.query();
while(inc.next()){
gs.print(inc.number);
}