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

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

Hi Rasheed,

What is the role required to scheduled? That profile is active but has only one role i.e snc_internal

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

try to set Run as -> System Admin

Regards
Ankur

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

Hi Ankur, As a System Admin also it is not working.

I have one doubt ..say suppose my schedule job is in domain -GRC Test and Run as(System Administrator) is in Global domain ...will this impact?