How do you keep your public holiday schedules up-to-date?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 03:06 AM
The public holiday schedule is a pain to keep updated as it is. But there must be a smarter dynamic way to do this?
I understand there are websites to get this information. But with regions like UAE and Asia public holidays giving random holidays at short notice this can make updating them a problem. We use these schedules to direct our servicedesk phone calls so can cause quite a problem if the data is incorrect.
How do you keep your public holiday schedules up-to-date?
I am curious to see how other companies keep theirs updated and be totally satisfied the data is correct.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2015 03:23 AM
Dynamic schedule entry for holiday list for SLA?
I had a little bit similar requirement with yours but even I dint find any solution for it.
What I had done, I had created a schedule job which will run once a year to achieve my requirement.(if holiday falls on Sundays, then Monday should be a holiday and if holiday falls on Saturday, then Friday should be an holiday).
Normally, most of the customers have their holiday calendar for year ready which you can use.
For short notices period holidays, I don't think there could be a solution rather than modifying it manually unless we define a smart process flow for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2015 02:56 AM
Thanks Deepak. We already have scheduled jobs once a year. Maybe we should increase the frequency to monitor them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2015 07:29 AM
Hi Deepak,
Did you create a schedule job to go thru the cmn_schedule_span table and modify the Start Date Time and End Date Time for the Public Holidays? Tried to do that but having problem updating the Start Date Time and End Date Time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2015 11:52 AM
Hello Steven,
Not actually, we dint modify the existing holiday time but created a new holiday based on our requirement.
Our requirement was to have a holiday on Friday if it falls on Saturday, and then have it on Monday if it falls on sunday.
Here is the code I used to create a compensate holiday for Saturday using scheduled job.
You can run this code as a background script to check it first in some dev instance.
It will create a compensated holiday for holidays falling on Saturday.
var gr = new GlideRecord('cmn_schedule_span');
gr.addQuery('schedule','390c5cec4f4406006681a7d18110c7e8'); // sys_id of schedule for which holiday is configured, you can use encoded query to query for multiple schedules at the same time
gr.addQuery('repeat_type','yearly');
gr.addQuery('yearly_type','doy');
gr.query();
while(gr.next())
{
gs.print('Schedule Namme: ' + gr.name);
gs.print('Scheduled Start Date Time ' + gr.start_date_time.getDisplayValue().toString());
var tr = new GlideDateTime(gr.start_date_time.getDisplayValue().toString());
gs.print('Day of the Week for Schedule: ' + tr.getDayOfWeekLocalTime());
if(tr.getDayOfWeekLocalTime() == 6) // here you need enter the actual day against which you want to create compensate holiday, here I want to create holiday on friday if it is falling on saturday and hence 6 represent saturday , Monday=1, Sunday=7.
{
var checkCount = 0;
var check = new GlideRecord('cmn_schedule_span');
check.addQuery('name','Compensate ' + tr.getDate() + ' ' + gr.name);
check.query();
while(check.next())
{
gs.print('schedule already exists');
checkCount++;
}
if(checkCount == 0)
{
var gr1 = new GlideRecord('cmn_schedule_span');
gr1.initialize();
gr1.name = 'Compensate ' + tr.getDate() + ' ' + gr.name; // give a schedule holiday a new name by prefixing "compensate"
gr1.schedule = '390c5cec4f4406006681a7d18110c7e8';
var start= new GlideDateTime(gr.start_date_time.getDisplayValue().toString());
//start.addSeconds(-86400);
start.addDaysLocalTime(-1); // substracting 1 day from the saturday holiday so new holiday start time should start from friday midnight
var end = new GlideDateTime(gr.end_date_time.getDisplayValue().toString());
//end.addSeconds(-86400);
end.addDaysLocalTime(-1);
gs.print(start.getValue());
gs.print(end.getValue());
gs.print(gr.start_date_time.getDisplayValue());
gs.print(gr.end_date_time.getDisplayValue());
gr1.start_date_time = start.getValue();
gr1.end_date_time = end.getValue();
gr1.type = gr.type;
gr1.show_as = gr.show_as;
gr1.insert();
}
}
}