Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2019 08:36 AM
1 ACCEPTED SOLUTION

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2019 09:15 AM
Create a scheduled job:
Create a script include:Below is the code from the screenshots:
Scheduled Job:
new closeIncidents().close();
Script Include:
var closeIncidents = Class.create();
closeIncidents.prototype = {
initialize: function() {
},
close: function() {
var incidents = new GlideRecord("incident");
incidents.addEncodedQuery("active=true^sys_created_on<=javascript:gs.beginningOfLast30Days()");
incidents.query();
while(incidents.next()) {
incidents.state = 6;
incidents.update();
}
},
type: 'closeIncidents'
};
Please mark this as correct/helpful if it resolved your issue!
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2019 09:29 AM
It is being set to resolved.
//This is setting the state to resovled
incidents.state = 6;
You can rename the function names/scheduled job name if you need to.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2019 09:41 AM
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Please mark this as correct/helpful if it resolved your issue!