Scheduled job not running automatically

ST9
Tera Contributor

I am having a schedule job which will run daily at 12am IST. When i manually use Execute Now, it was working as expected but not working at scheduled time mentioned

I have kept Run as Global scheduler( time zone for Global scheduler is GMT so i converted 12am IST to GMT i.e - 18:30pm)

Let me know what is i'm doing wrong-

find_real_file.png

var app = new GlideRecord('sn_grc_indicator_task');
app.addEncodedQuery('stateIN1,2,4,9^due_date<javascript:gs.beginningOfToday()');
app.query();
while (app.next()) {
	if(app.state=='1' || app.state=='2'){
		gs.info('Line 25'+app.number);
    app.u_anomaly_sign_off = true;
    app.state = '9';
    gs.eventQueue('sn_grc.indTask_anomaly_signoff_incomp', app, getMailId(app.indicator.u_manager.toString()), '');
    app.result='failed';
	app.u_due_date_passed = 'scheduled job';
	if(app.work_start ==''){
		app.work_start = app.sys_created_on;
	}
	app.work_end = new GlideDateTime();
	var durationMinutes = new sn_grc.GrcProfileUtils().getTHTValue(app.work_start);
	app.u_tht.setDateNumericValue(durationMinutes * 60 * 1000);
    app.update();
	

}
}
    
1 ACCEPTED SOLUTION

Musab Rasheed
Tera Sage
Tera Sage

Hello,

Is 'Global Scheduler' is active user record.? if not make it active, moreover try to put run as someone who has Admin rule, at least create a local account and see if that works, it may be possible that due to roles it is not working.? Lastly you can even keep Run as empty and try to see if that works.

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

View solution in original post

6 REPLIES 6

I don't think any issue for that

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Dominik Paluch
Tera Contributor

I had the same issue today with integration. I had constantly 401 status when i wanted to execute "GET" method from schedule automatically. The way i fixed it, it by adding admin access to integration user. Now outbound http logs are returning 200 status 🙂.