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

OCRotaICalendarSNC- Global

The OCRotaICalendarSNC script include provides iCal formatted events for the a specific user's rotation.

Parent Topic:Server API reference

OCRotaICalendarSNC - cleanExpiredCache ()

Records in the cmn_rota_resp_cache table that have a From date prior to today.

NameTypeDescription
None  
TypeDescription
void 

OCRotaICalendarSNC - createCalendarEvents (String groupId, String rotaId, String userId, Object dateRangeObj)

Returns list of AJAXScheduleItems for the user's on-call.

NameTypeDescription
groupIdStringThe group sys id.
rotaIdStringThe rota sys id.
userIdStringThe user sys id.
dateRangeObjObjectContains the from and to dates for the data set.
TypeDescription
AJAXScheduleItemJava list of AJAXScheduleItems.

Creates a VEVENT based on the scheduleItemSpan provided.

NameTypeDescription
groupNameStringName of the on-call group.
scheduleItemSpanObjectSpan of time for the on-call period.
calendarLinkStringA link back to the on-call calendar in the instance.
TypeDescription
StringA VEVENT based on the scheduleItemSpan provided.

Creates a formatted iCalendar if the user has no upcoming on-call.

NameTypeDescription
rotaGRGlideRecordThe cmn_rota glide record.
dateRangeObjObjectContains the from and to dates for the data set.
calendarLinkStringA link to the on-call calendar for this user.
TypeDescription
StringFormatted iCalendar with a placeholder VEVENT.

OCRotaICalendarSNC - getCalendarEvents (String groupId , String rotaId, String userId , Object dateRangeObj, Boolean useCache)

Returns the formatted iCalendar for the user's rotation.

NameTypeDescription
groupIdStringThe group sys id.
rotaIdStringThe rota sys id.
userIdStringThe user sys id.
dateRangeObjObjectContains the from and to dates for the data set.
useCacheBooleanIf true, makes use of the cache table cmn_rota_resp_cache.
TypeDescription
StringFormatted iCalendar for the user's rotation.

OCRotaICalendarSNC - getEventsFromTable (String groupId, String rotaId, String userId, Object dateRangeObj)

Returns the formatted iCalendar for the user's rotation if found in the cmn_rota_resp_cache table.

NameTypeDescription
groupIdStringThe group sys id.
rotaIdStringThe rota sys id.
userIdStringThe user sys id.
dateRangeObjObjectContains the from and to dates for the data set.
TypeDescription
StringFormatted iCalendar for the user's rotation if found in the cmn_rota_resp_cache table.

OCRotaICalendarSNC - getIntersectRotaSpanItem (ScheduleTimeSpan timeSpan, Array rotaSpanItems)

Checks whether the provided timeSpan intersects with one of the rota span items.

NameTypeDescription
timeSpanScheduleTimeSpanA single span for the user's on-call.
rotaSpanItemsArrayContains the user's standard on-call spans.
TypeDescription
ObjectIf the timeSpan intersects with one of the rota span items, returns an object containing the rota span item and the span that it intersects with.

OCRotaICalendarSNC - getMemberCalendarURL (String groupId, Object rotaId, String userId)

Creates the subscribable URL for the user's iCalendar.

NameTypeDescription
groupIdStringThe group sys id.
rotaIdObjectThe rota sys id.
userIdStringThe user sys id.
TypeDescription
StringThe subscribable URL for the user's iCalendar.

OCRotaICalendarSNC - getOnCallCalendarURL (GlideRecord rotaGR)

Returns a URL to the on-call calendar based on the rota record.

NameTypeDescription
rotaGRGlideRecordA cmn_rota record.
TypeDescription
StringURL to the on-call calendar based on the rota record.

OCRotaICalendarSNC - handleOverrideMember (AJAXScheduleItem scheduleItem)

Returns an array of the user's overrides (extra coverage).

NameTypeDescription
scheduleItemAJAXScheduleItemA list of AJAXScheduleItems.
TypeDescription
ArrayAn array of the user's overrides (extra coverage).

OCRotaICalendarSNC - handleRotaMember (AjaxSchedueItem scheduleItem , Object rotaSpanItems, Object definitionItems, Array repeatRotaSpanIdArr)

Returns an object containing the user's override (extra coverage) and excluded spans.

NameTypeDescription
scheduleItemAJAXSchedueItemA list of AJAXScheduleItems.
rotaSpanItemsObjectContains the user's standard on-call spans.
definitionItemsObjectContains the rota's standard on-call spans.
repeatRotaSpanIdArrArrayAn array of rota span sys ids.
TypeDescription
ObjectContains the user's override (extra coverage) and excluded spans.

OCRotaICalendarSNC - invalidateRotaRespCache (GlideRecord rotaRespCacheGR)

Used by business rules on the cmn_rota_member, cmn_schedule_span, and roster_schedule_span tables to update the cmn_rota_resp_cache table.

NameTypeDescription
rotaRespCacheGRGlideRecordRecord that has been updated.
TypeDescription
void 

OCRotaICalendarSNC - matchRotaSpanRule(ScheduleTimeSpan timeSpan, Array rotaSpanItems, Array repeatRotaSpanIdArr, Object seriesStartTimes)

Checks whether the provided timeSpan matches one of the rotaSpanItems.

NameTypeDescription
timeSpanScheduleTimeSpanA single span for the user's on-call.
rotaSpanItemsArrayContains the user's standard on-call spans.
repeatRotaSpanIdArrArrayAn array of rota span sys ids.
seriesStartTimesObjectStart time of the rota spans.
TypeDescription
BooleanReturns true if the timeSpan matches one of the rotaSpanItems.

OCRotaICalendarSNC - populateCalendarSubscriptionSettings ()

Used by fixed job to populate the calendar subscription fields on the cmn_rota form

NameTypeDescription
None  
TypeDescription
void 

OCRotaICalendarSNC - processSeriesEvent (List scheduleItems, Array repeatRotaSpanIdArr , String userId)

Returns an object containing the user's rotations.

NameTypeDescription
scheduleItemsListThe user's on-call rotation as an AJAXScheduleItem list.
repeatRotaSpanIdArrArrayAn array of the cmn_rota schedule span record sys_ids.
userIdStringThe user sys id.
TypeDescription
ObjectContains the user's rotations.

OCRotaICalendarSNC - saveCalendarEvents (String groupId, String rotaId, String userId, Object dateRangeObj, String result)

Inserts the user's iCalendar into the cmn_rota_resp_cache table.

NameTypeDescription
groupIdStringThe group sys id.
rotaIdStringThe rota sys id.
userIdStringThe user sys id.
dateRangeObjObjectContains the from and to dates for the data set.
resultStringThe user's iCalendar.
TypeDescription
void 

OCRotaICalendarSNC - sendCalendarURL (GlideRecord rotaGR)

Queues events to send an email to all members of the rotation.

NameTypeDescription
rotaGRGlideRecordA cmn_rota record.
TypeDescription
void 

OCRotaICalendarSNC - updateExceptionList (AJAXScheduleItem scheduleItem, ScheduleTimeSpan timeSpan, Array rotaSpanItems)

Returns an object that contains all of the timeSpans that need to be excluded from the user's iCalendar.

NameTypeDescription
scheduleItemAJAXScheduleItemOne AJAXScheduleItem.
timeSpanScheduleTimeSpanA single user's standard on-call span.
rotaSpanItemsArrayContains the user's standard on-call spans.
TypeDescription
ObjectObject that contains all of the timeSpans that need to be excluded from the user's iCalendar.