Scheduled Job not running even on Execute Now

rpatnaik
Kilo Contributor

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

 

39 REPLIES 39

No nothing is being printed Harsh...

are you updating the scoped application record  ?

just for testing , take a backup of your script and only add gs.log('testing'); and see if it's printing the log or not so this way you can confirm the issue is due to the script or something else. 

Harsh....Yes i have created a Test Scheduled job with only single log statement...still the log is not printed

 

Regards,

Rashmita

strange.

 

go to sysevent table, whenever scheduled job execute it creates any entry there. 

screenshot for reference. 

 

find_real_file.png

 

if still its not working try to create new scheduled job and see if its working or not. 

 

If my answer helped you, kindly mark it as helpful and correct.