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
11-02-2020 04:51 PM
Hello,
Does this issue resolved for you. I am seeing the same issue on our instance. Even just the gs.info() message is not executing through scheduled job.
Please share the solution if this is resolved for you. I have submitted a HI ticket right now and waiting for their response
Thanks,
Lakshmi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 01:46 AM
Have you tried doing it as a scheduled flow instead?
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2020 02:16 AM
Hi,
Can you share the full image of the test schedule job you running.
And also can you run test schedule script with gs.info("test");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2021 04:58 AM
I am also facing a similar issue. I have a scheduled job which is not starting. I can't find anything in logs also.
Did anyone find a workaround for this?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2023 11:31 PM
Hi @rpatnaik @navshar @Harsh Vardhan ,
Have you know any workaround for this. I am also facing the same issue, schedule job is not running and unable to get logs.
In the events table it is in the processed state.
Regards,
Sri