Query for getting last 6 month record
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2024 12:30 AM
Query for getting last 6 month record from 'incident" table without using encoded query.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2024 01:33 AM
@shid077 please use below script
var increc = new GlideRecord('incident');
// last 6 months inc records
increc.addQuery('sys_created_on','>',gs.monthsAgo(6));
increc.query();
while(increc.next())
{
gs.info('Incident Number: ' + increc.getValue('number'));
gs.info('Total Incidents: ' +increc.getRowCount());
}
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
CB