- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 02:54 AM
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-
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();
}
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:07 AM
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
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:07 AM
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
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:17 AM
Hi Rasheed,
What is the role required to scheduled? That profile is active but has only one role i.e snc_internal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:18 AM
Hi,
try to set Run as -> System Admin
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 03:43 AM
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?