why the script doesn't working in scheduled job but the same code works in background script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 04:58 AM
The script in schedule job is not working and logs also not printing but the same code works in background script.
- Labels:
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 05:00 AM
Is ur scheduled job active?? If yes , can u share the code here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 05:13 AM
var gru = new GlideRecord('sys_report');
gru.addQuery('sys_id', 'ae8a4aa9db24ff081787944bdb96198e');
gru.query();
if(gru.next()) {
var z_now = gs.nowNoTZ();
var d1=CRA_CalDateOf('d', +4, z_now, true);
var d2=CRA_CalDateOf('d', +7, z_now, false);
var c='08:00:00';
var t= d2+' '+c;
var newfilter="parent.sys_class_name=change_request^parent.ref_change_request.start_date>="+d1+"^parent.ref_change_request.start_date<="+t+"^ORparent.ref_change_request.end_date>="+d1+"^parent.ref_change_request.end_date<="+t+"^assignment_group=84b5f5152b446e0072751cf405da1555^approvalINapproved";
gru.filter=newfilter;
gru.autoSysFields(false);
gru.setWorkflow(false);
gru.update();
gs.print(gru.filter);
}
In this script we are updating the filter condition of the report.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 05:10 AM
Hi pallavi
Looks like you already raised a post(https://community.servicenow.com/community?id=community_question&sys_id=505f715ddb4681d0a53882630596...)
are both the same issues?
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 05:14 AM
yes