Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

OCRotation- Global

The OCRotation script include provides methods to build a data structure that is used to display a calendar.

The code builds up the GlideAJAXSchedulePage object which stores a list of span items. You can use this type for the Gwt (legacy) calendar. See the OCRotationV2 - Global script include for other calender types. This is part of On-Call Scheduling.

Parent Topic:Server API reference

OCRotation - buildRotas()

Builds the on-call coverage based on your groups, rotas, and rosters. This is used by the OCRotationV2 - getSpans method.

NameTypeDescription
None  
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()

OCRotation - getEndDate()

Returns the end date for the time period for which you want to retrieve on-call coverage.

NameTypeDescription
None  
TypeDescription
StringEnd date for the time period for which you want to retrieve on-call coverage.

OCRotation - getGroupIds()

Returns a comma separated list of group sys_id (sys_user_group) values for an on-call schedule.

NameTypeDescription
None  
TypeDescription
StringComma separated list of group sys_id (sys_user_group) values for an on-call schedule.

OCRotation - getRosterIds()

Returns the rosters according to the selected rotas.

NameTypeDescription
None  
TypeDescription
StringRosters according to the selected rotas.

OCRotation - getRotaGr(String rotaIds, String groupIds, String rosterIds, String userIds)

Returns a GlideRecord for the cmn_rota table filtered by groups, rota, users, and roster.

NameTypeDescription
rotaIdsStringComma separated list of rota sys_id (cmn_rota) values for an on-call schedule.
groupIdsStringComma separated list of group sys_id (sys_user_group) values for an on-call schedule.
rosterIdsStringComma separated list of roster sys_id (cmn_rota_roster) values for an on-call schedule.
userIdsStringComma separated list of user sys_id (sys_user) values for an on-call schedule.
TypeDescription
GlideRecordA GlideRecord for the cmn_rota table filtered by groups, rota, users, and roster.

OCRotation - getRotaIds()

Returns the rotas for the groups on your calendar.

NameTypeDescription
None  
TypeDescription
StringRotas for the groups on your calendar.

OCRotation - getStartDate()

Returns the start date for the time period for which you want to retrieve on-call coverage.

NameTypeDescription
None  
TypeDescription
StringStart date for the time period for which you want to retrieve on-call coverage.

OCRotation - getTimezone()

Returns the timezone that your on-call calendar will use.

NameTypeDescription
None  
TypeDescription
StringTimezone that your on-call calendar will use. For example, Europe/Madrid and US/Pacific.

OCRotation - getUserIDs()

This will filter the schedules return by users. Get comma separated list of user sys_id (sys_user) values used to filter on-call schedules.

NameTypeDescription
None  
TypeDescription
StringComma separated list of user sys_id (sys_user) values used to filter on-call schedules.

OCRotation - setEndDate(String endDate, Boolean inclusive)

Set the end date for the time period for which you want to retrieve on-call coverage. If the end date is not set, then the last day of the next month is applied by default. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
endDateString[Optional] End date of the on-call schedule.
inclusiveBoolean[Optional] When true, the end date is included in the time span. If not specified, this value defaults to true.
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setGroupIds(String groupIds)

Filters the schedules return by groups. Set comma separated list of group sys_id (sys_user_group) values for an on-call schedule. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
groupIdsStringComma separated list of group sys_id (sys_user_group) values for an on-call schedule.
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setRosterIds(String rosterIds)

Sets the rosters according to the selected rotas. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
RosterIdsStringRosters according to the selected rotas.
TypeDescription
void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setRotaIds(String rotaIds)

Sets the rotas for the groups on your calendar. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
RotaIdsStringRotas for the groups on your calendar.
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setStartDate(String startDate)

Sets the start date for the time period for which you want to retrieve on-call coverage. If the start date is not set, then the first day of the previous month is applied by default. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
startDateString[Optional] Start date for the time period for which you want to retrieve on-call coverage.
TypeDescription
void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setTimezone(String timezone)

Sets the timezone that your on-call calendar will use. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
TimezoneStringTimezone that your on-call calendar will use. For example, Europe/Madrid and US/Pacific.
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()

OCRotation - setUserIds(String userIds)

Sets comma separated list of user sys_id (sys_user) values used to filter on-call schedules. Use in conjunction with OCRotationV2 - getSpans.

NameTypeDescription
UserIdsStringComma separated list of user sys_id (sys_user) values used to filter on-call schedules.
TypeDescription
Void 

Related topics

OCRotationV2 - getSpans()