
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 02:05 AM
Would adding a script on the Condition box (when Conditional is checked) achieve this? We don't want to set up 5 different Weekly scheduled reports as much as possible so we want to just setup 1 scheduled report then perhaps add a script on the Condition to limit it on sending only on weekdays.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 02:29 AM
Hi Jimboy,
If you dont have a schedule defined, you could also use below script:
function checkWeekday(){
var today = new GlideDateTime();
var dayOfWeek = today.getDayOfWeek();
var answer = false;
if(dayOfWeek == 1 || dayOfWeek == 2 || dayOfWeek == 3 || dayOfWeek == 4 || dayOfWeek == 5){ // 1=Monday and so on..
answer = true;
}
return answer;
}
checkWeekday();
Regards,
Prajakta
PS - Hit Like, Helpful or Correct Answer based on the impact of the response!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 02:21 AM
Hi Jimboy,
You can schedule a report daily and put the below script in condition if you have a weekday schedule defined in the system:
function checkWeekdays() {
//var now = new Date();
var day = now.getDay();
var result = false;
var s = new Packages.com.glide.schedules.Schedule("put your schedule sys_id here");
var gdt = new GlideDateTime();
if(s.isInSchedule(gdt, "put your schedule name here") ) {
result = true;
}
return result;
}
checkWeekdays();
Regards,
Prajakta
PS - Hit Like, Helpful or Correct Answer based on the impact of the response!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 02:25 AM
Packages.com.glide.schedules.Schedule can be replaced with GlideSchedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 02:29 AM
Hi Jimboy,
If you dont have a schedule defined, you could also use below script:
function checkWeekday(){
var today = new GlideDateTime();
var dayOfWeek = today.getDayOfWeek();
var answer = false;
if(dayOfWeek == 1 || dayOfWeek == 2 || dayOfWeek == 3 || dayOfWeek == 4 || dayOfWeek == 5){ // 1=Monday and so on..
answer = true;
}
return answer;
}
checkWeekday();
Regards,
Prajakta
PS - Hit Like, Helpful or Correct Answer based on the impact of the response!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 05:00 AM
Hi Prajakta,
Tested this and it is working great. Thanks!