Disocvery

Suhail2297
Tera Contributor

Hello Everyone,

 

I have a requirement to add the max_run (Max run time ) of discovery schedules to 2 hours for which i have written an scheduled job and its not working...can someone please guide?

(function() {
    var maxLimit = 7200; // 2 hours in seconds
    var gr = new GlideRecord('discovery_schedule');
    gr.addQuery('max_run', '!=', maxLimit);
    gr.query();
    var count = 0;
 
    while (gr.next()) {
        gr.max_run = maxLimit;
        gr.update();
        gs.info('Updated Discovery Schedule: ' + gr.name + ' → max_run_time set to ' + maxLimit + ' seconds');
        count++;
    }
 
    gs.info(' Scheduled Job completed: ' + count + ' discovery schedules updated to 2-hour max run time.');
})();
 
Regards,
Suhail
0 REPLIES 0