Scheduled Job not running even on Execute Now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 12:54 AM
Hi All,
Need a help in running the Scheduled job.The scheduled job is convert a risk into an issue after 10 days of the due date in Risk Form.The Risk state has to be 'Convert Issue' once the issue is created .But the Scheduled job is not running on the Scheduled time or on clicking the 'Execute Now'.But when i run it from the background Script i get the expected outcome.
Please help me to run the script.
Script is as below:
var ps = 10;
var pn = parseInt(ps);
var gt=new GlideDateTime();
var query ='issueISEMPTY';
if (pn >= 0) {
var grrisk= new GlideRecord('risk');
grrisk.addEncodedQuery(query);
grrisk.addQuery('due_date', '<', gs.daysAgo(pn));
grrisk.addQuery('sys_id','*****************');
grrisk.query();
while(grrisk.next()) {
var grissue = new GlideRecord('issue');
grissue.short_description = grrisk.short_description;
grissue.description = grrisk.description;
grissue.assigned_to = grrisk.assigned_to;
grissue.risk = grrisk.sys_id;
grissue.parent = grrisk.task;
var issueSys = grissue.insert();
grrisk.issue = issueSys;
grrisk.state = 'convert_Issue';
grrisk.update();
}
}
Thanks in advance
Rashmi
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 04:05 AM
can you try to ask other admin user to execute that scheduled job ? also any of the existing scheduled job is working on your instance ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2020 10:29 PM
This is an issue with the instance as the same code works in other instances.
Thank you for all the help

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 12:58 AM
Hi
Can you press f12 and check if there are any errors in the console?
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 01:33 AM
hi ,
Can you do the following.
1. please check the scope of the schedule job .
2.please try to test via schedule with next available minute.(say 5 minute).
3.Look at the logs.
Thanks
Luxo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 01:39 AM
No Luck ...Luxo