Basic Shift APIs
Use the ShiftManager class to interact with shift plan-related APIs. These basic shift APIs are useful to maintain and operate with shift plan, shift, and shift segment definitions.
* 
Basic Shift APIs must be called in Groovy code. REST calls are not supported.
Retrieve All Active Shifts
getAllShifts(boolean activeOnly)
By default, all active shifts are retrieved. To get all records including inactive shifts, use getAllShifts(false). Return type is List<MaxObject>.
Retrieve Shift List With Specified Name
getShift(String name)
In cases where the name is not unique, zero or multiple shifts can sometimes be returned. Return type is List<MaxObject>.
Retrieve Single Shift With Specified UUID
getShift(UUID shiftId)
Return type is MaxObject.
Set Passed-in Shift Value for Logged-in User
setConfiguredShift(UUID shiftId)
Set Passed-in Shift Value for Specified User
setConfiguredShift(UUID userId, shiftId)
Create Shift Plan Record
createShiftPlan(String name, LocalDate startDate, Integer shiftCycle, ShiftCycleUnit shiftCycleUnit, String timezone)
Return type is MaxObject.
Create Shift Record
createShift(UUID shiftPlan, String name)
A previously created Shift Plan is required. Inherits the shift cycle and shift cycle unit value from the related Shift Plan record. Return type is MaxObject.
Shift Detail APIs
Use the following APIs to create Shift Segment records based on the Shift Cycle unit value defined in Shift records. To use these APIs, a previously created Shift record is required. Return type is MaxObject.
Create Day-Based Shift Segment Record
createDayShiftSegment(UUID shift, String name, List<String> days, LocalTime fromTime, Period duration, UUID segmentType)
Create Week-Based Shift Segment Record
createWeekShiftSegment(UUID shift, String name, List<String> weeks, List<String> weekDays, LocalTime fromTime, Period duration, UUID segmentType)
Create Month-Based Shift Segment Record
createMonthShiftSegment(UUID shift, String name, List<String> months, List<String> weekDays, LocalTime fromTime, Period duration, UUID segmentType)
Was this helpful?