If users have the default 24-hour representation for date/times, they get a properly formatted email.

If users have changed the system time property so the format is a 12-hour representation with AM and PM, the body of the table loses the content for the rota name and the roster name, and the rest of the cells are shifted left so the on-call information in the rows of the table fails to align with the header. Also, you will see the initial date of the on-call time span duplicated in the header, and the time span will end one day early.

Steps to Reproduce


1) Enable On-Call Scheduling plugin; do not load demo data.
2) Create a new Rota (Create New Schedule) for the out-of-box Network group; have the rota start date set to 2015-09-01, and put all 5 members of the group into the rota; only create one roster.
3) Navigate to the group record, and for each of the users in the group, make sure email is enabled.
4) Get the sys_id of the group, and use the following test script in Scripts - Background to generate the reminder email for the selected time span (2015-09-24 through 2015-09-30).
5) Check the email by previewing HTML; note that it displays as expected (see attached 'Email with full expected content' screenshot).
6) Change the system time format property (glide.sys.time_format=hh:mm:ss a), and rerun the test script in Scripts - Background.
7) Check the email by previewing HTML; note the missing rota name and roster name cells (see 'Email with missing rota and roster cells').
8) Go to cmn_rota and select the new rota you created.
9) Click the Resend Reminders UI Action.

The FormattedScheduleReport script include, in the buildSchedule and buildRotaScheduleInTimeZone functions, ends up inserting an initial span which ends up being a one second span if the system time format is set to hh:mm:ss a (hours/minutes/seconds AM/PM). This causes the getHTML function to drop the first two cells in the table row for the rota name and the roster name, as it is looping through the timespan (values get wiped in lines 425 through 428).

var oncall = new OnCallRemindersNG();
var users = {}; // recepients of reminders
var rotaGR = new GlideRecord('cmn_rota');
rotaGR.get('db30cf904ffa02002fa02f1e0210c74a'); // Replace this sys_id with the rota of your group
var rosterGR = new GlideRecord('cmn_rota_roster');
rosterGR.addQuery('rota', rotaGR.getUniqueValue());
rosterGR.addQuery('send_reminders', true);
var thecurrenttime = new GlideDateTime();
var rosterStartTime = new GlideDateTime('2015-09-24 07:00:00');
var rosterEndTime = new GlideDateTime('2015-10-01 06:59:59');
if (rosterGR.next()) {
    gs.print(thecurrenttime.getDisplayValue()+' '+rosterStartTime.getDisplayValue()+' '+rosterEndTime.getDisplayValue());
    oncall.addEmailRecepients(rotaGR, rosterGR.getUniqueValue(), rosterStartTime, rosterEndTime, users);
    oncall.sendEmails(rotaGR, rosterStartTime, rosterEndTime, users);


 Import Script Include: FormattedScheduleReport attached here

    Related Problem: PRB648428

    Seen In

    Eureka Patch 10
    Eureka Patch 11
    Fuji Patch 7 Hot Fix 5
    Geneva Patch 5

    Fixed In


    Associated Community Threads

    There is no data to report.

    Article Information

    Last Updated:2016-08-19 16:02:40