{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1079,"path":"api-reference/server-api-reference/c_OCRotation.md","title":"OCRotation - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# OCRotation- Global\n\nThe OCRotation script include provides methods to build a data structure that is used to display a calendar.\n\nThe 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](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md) script include for other calender types. This is part of On-Call Scheduling.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## OCRotation - buildRotas\\(\\)\n\nBuilds the on-call coverage based on your groups, rotas, and rosters. This is used by the OCRotationV2 - getSpans method.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - getEndDate\\(\\)\n\nReturns the end date for the time period for which you want to retrieve on-call coverage.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|End date for the time period for which you want to retrieve on-call coverage.|\n\n## OCRotation - getGroupIds\\(\\)\n\nReturns a comma separated list of group sys\\_id \\(sys\\_user\\_group\\) values for an on-call schedule.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Comma separated list of group sys\\_id \\(sys\\_user\\_group\\) values for an on-call schedule.|\n\n## OCRotation - getRosterIds\\(\\)\n\nReturns the rosters according to the selected rotas.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Rosters according to the selected rotas.|\n\n## OCRotation - getRotaGr\\(String rotaIds, String groupIds, String rosterIds, String userIds\\)\n\nReturns a GlideRecord for the cmn\\_rota table filtered by groups, rota, users, and roster.\n\n|Name|Type|Description|\n|----|----|-----------|\n|rotaIds|String|Comma separated list of rota sys\\_id \\(cmn\\_rota\\) values for an on-call schedule.|\n|groupIds|String|Comma separated list of group sys\\_id \\(sys\\_user\\_group\\) values for an on-call schedule.|\n|rosterIds|String|Comma separated list of roster sys\\_id \\(cmn\\_rota\\_roster\\) values for an on-call schedule.|\n|userIds|String|Comma separated list of user sys\\_id \\(sys\\_user\\) values for an on-call schedule.|\n\n|Type|Description|\n|----|-----------|\n|GlideRecord|A GlideRecord for the cmn\\_rota table filtered by groups, rota, users, and roster.|\n\n## OCRotation - getRotaIds\\(\\)\n\nReturns the rotas for the groups on your calendar.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Rotas for the groups on your calendar.|\n\n## OCRotation - getStartDate\\(\\)\n\nReturns the start date for the time period for which you want to retrieve on-call coverage.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Start date for the time period for which you want to retrieve on-call coverage.|\n\n## OCRotation - getTimezone\\(\\)\n\nReturns the timezone that your on-call calendar will use.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Timezone that your on-call calendar will use. For example, **Europe/Madrid** and **US/Pacific**.|\n\n## OCRotation - getUserIDs\\(\\)\n\nThis will filter the schedules return by users. Get comma separated list of user sys\\_id \\(sys\\_user\\) values used to filter on-call schedules.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|String|Comma separated list of user sys\\_id \\(sys\\_user\\) values used to filter on-call schedules.|\n\n## OCRotation - setEndDate\\(String endDate, Boolean inclusive\\)\n\nSet 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|endDate|String|\\[Optional\\] End date of the on-call schedule.|\n|inclusive|Boolean|\\[Optional\\] When true, the end date is included in the time span. If not specified, this value defaults to true.|\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setGroupIds\\(String groupIds\\)\n\nFilters 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|groupIds|String|Comma separated list of group sys\\_id \\(sys\\_user\\_group\\) values for an on-call schedule.|\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setRosterIds\\(String rosterIds\\)\n\nSets the rosters according to the selected rotas. Use in conjunction with OCRotationV2 - getSpans.\n\n|Name|Type|Description|\n|----|----|-----------|\n|RosterIds|String|Rosters according to the selected rotas.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setRotaIds\\(String rotaIds\\)\n\nSets the rotas for the groups on your calendar. Use in conjunction with OCRotationV2 - getSpans.\n\n|Name|Type|Description|\n|----|----|-----------|\n|RotaIds|String|Rotas for the groups on your calendar.|\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setStartDate\\(String startDate\\)\n\nSets 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|startDate|String|\\[Optional\\] Start date for the time period for which you want to retrieve on-call coverage.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setTimezone\\(String timezone\\)\n\nSets the timezone that your on-call calendar will use. Use in conjunction with OCRotationV2 - getSpans.\n\n|Name|Type|Description|\n|----|----|-----------|\n|Timezone|String|Timezone that your on-call calendar will use. For example, **Europe/Madrid** and **US/Pacific**.|\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n## OCRotation - setUserIds\\(String userIds\\)\n\nSets comma separated list of user sys\\_id \\(sys\\_user\\) values used to filter on-call schedules. Use in conjunction with OCRotationV2 - getSpans.\n\n|Name|Type|Description|\n|----|----|-----------|\n|UserIds|String|Comma separated list of user sys\\_id \\(sys\\_user\\) values used to filter on-call schedules.|\n\n|Type|Description|\n|----|-----------|\n|Void| |\n\n**Related topics**  \n\n\n[OCRotationV2 - getSpans\\(\\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/c_OCRotationV2.md)\n\n"}}