Auto Shifts

The Auto Shifts workflow extension automates shift changes in the Schedule Planner when employees work a shift in the rotation other than the one for which they are scheduled.

Note: This business process is an extension model that is developed outside the normal release schedule to meet specific customer needs. To request one of these models, you must submit a Salesforce Service Request to UKG. After the model is delivered to your tenant, you can edit it to meet your needs.

Organizations with employees who work a rotation schedule often have last minute changes. Exceptions and incorrect pay can occur when these shift changes are not added to the Schedule Planner.

The Auto Shifts process uses the employee’s first In punch of the day to detect shift changes, and then automatically applies the appropriate shift depending upon the employee’s pay rule.

The business process is attached to any Punch In button in the Attestation Model, which allows employees to confirm, or reject, the adjusted shift.

With the Auto Shifts configuration, you define:

  • Time spans and shifts for different groups of people.

  • Whether the shift adjustment requires employee confirmation.

User experience

Auto shift applied

When an employee’s first In punch falls outside the expected span of the scheduled shift start, the process replaces the shift in the Schedule Planner with the adjusted shift, and then adds a Comment and Note to trace the original shift. For example, an employee is originally scheduled to work the 8:00 AM — 4:00 PM day shift. The first In punch at 1:30 PM aligns with the 2:00 PM - 10:00 PM late shift. The process replaces the day shift with the night shift in the Schedule Planner, and then adds a Comment and Note.

Schedule change confirmation

When enabled, the process only makes the shift adjustment upon employee confirmation. If an In punch occurs in a time span associated with a different shift in the rotation, the employee can retain the scheduled shift by choosing “No” to bypass the Auto Shift process. For example, an employee arrives before the scheduled shift to work overtime, but chooses “No” to keep the original shift in the Schedule Planner.

If an In punch occurs in a time span associated with a different shift in the rotation, the employee can adjust the scheduled shift by choosing “Yes” to initiate the Auto Shift process. For example, an employee arrives after the scheduled shift to work another shift in the rotation, and chooses “Yes” to adjust the shift in the Schedule Planner.

Considerations and limitations

  • Shift templates must exist in the application.

  • An appropriate attestation profile must be assigned to each eligible employee who uses the Attestation Model for confirming shift changes.

Before you start

Before you configure this business process, you must configure the following:
  • Attestation configurationsSee the Configure Attestation topic.

    • Attestation Conditions: Create an attestation condition with a type of Always.

    • Attestation Buttons: Create or edit an attestation button, such as Auto Shift. Select the following options during configuration of the button:

      • Button Type: Punch In

      • Show Assignment At Devices: Employee selects Assignment

      • Punch Collection Time: Capture time before attestation

      • Timecard Timeframe: Today

      • Display Type: Web and Clock

    • Attestation Assignments: Create an attestation assignment for the Auto Shift button. Select Always in the Condition field, and then select AutoShifts_v3 in the Punch Button Workflow selection.

    • Attestation Profile: Create or edit an existing attestation profile. Add the attestation assignment applicable to the Auto Shifts workflow. Assign the attestation profile to managers and employees.

  • Comments: Create a comment that the workflow applies when it updates the shift template. See the Comments topic.

    Auto shift applied

Configure the Auto Shifts business process model

Note: The process for configuring and deploying this and other Business Process Extensions is the same as all Business Process models .
  1. Migrate the Auto Shifts business process model to the customer tenant.
    1. Log in to the appropriate tenant.

    2. Go to Main Menu > Administration > Setup Data Manager.

    3. Select the Source tenant where the Process Model resides, and select the template to copy. It is a .zip file. A message appears in the Source column: Source: Import from AutoShifts_v3.zip.

    4. Click Tap Review and Publish. The Publish Summary panel appears.

    5. Review the Publish Summary panel. It lists the items that were extracted from the migration file. If you approve, click tap Publish with Comment or just Publish.

    6. Click Tap Go to Publish History at the bottom of the panel to view the status of the data transfer. The Publish History page contains a table that lists the items you have published. If there were errors during the transfer, the button under the Errors column for that row is black.

    7. To view details, click tap the appropriate row and click tap View Selected.

    8. On the History for publish run page, click tap Show all to view the setup data that you published, and the errors that occurred, if any, listed by item type and name.

  2. Configure the Auto Shifts decision tables.
    Note: Decision tables are configurable based on user requirements and can be changed accordingly. These tables are dynamic and can be updated at any time without redeployment of the process model.
    1. Go to Main Menu > Administration > Application Setup > Business Process setup > Process Models.

    2. Select the AutoShifts_v3 process and click Edit. The process model enters edit mode.

    3. Select the Decision Tables tab.

    4. Click Everyone's, and then select the decision table to edit.

    5. Click Decision Table Editor to add or update the rows in the table.

    6. Click Save and close.
      Caution:
      • Values entered in the decision tables are case-sensitive, and must match configured values in the application.

      • Do not remove variables, variable names, or variable types from any decision table.

      Edit the following decision tables:
      AutoShifts_Config — Controls various options for the auto shift process.

      Auto Shifts — Config decision table structure

      Variable nameDescriptionValue
      DisplayAttestationFormDetermines whether the attestation form is presented to the employee for shift change confirmation.Yes or No
      Note: You must set DisplayAttestationForm = No when the Auto Shifts extension is utilized on clocks; forms are not supported in that context.
      CommentTypeComment that the process adds to the adjusted shift in the Schedule Planner.Auto shift applied
      DisplayShiftLabelControls whether the shift label displays in confirmation form.Yes
      DisplayShiftTimeControls whether the shift times display in confirmation form.Yes
      Admin Internal user; do not change.SERVICE-LEVEL1
      Note:
      • DisplayAttestationForm, DisplayShiftLabel, and DisplayShiftTime must contain "Yes" or "No"; these values are not case-sensitive.
      • When DisplayAttestationForm = "Yes", either DisplayShiftLabel or DisplayShiftTime must equal "Yes".
      • CommentType must contain a Comment defined in the application; the value is case-sensitive.
      AutoShifts_Variables — Defines the start and end times that correspond with shifts that span the day divide; and then correlates the shift template with the pay rule to incorporate appropriate zone rules.

      Auto Shifts — Variables decision table structure

      Variable nameDescription
      Serial NoIncremental identifier.
      From(HH:mm)Identifies the start time of the shift that spans the day divide.
      Important: The workflow process includes the first minute.
      Caution:

      Must be entered using 24-hour format (HH:mm).

      To(HH:mm)Identifies the end time of the shift that spans the day divide.
      Important: The workflow process includes the last minute.
      Caution:

      Must be entered using 24-hour format (HH:mm).

      ShiftTemplateIdentifies the shift template assigned to the time span.
      PayRuleContains a semicolon-separated (;) list of pay rules that are associated with the ShiftTemplate.
      OperatorIdentifies how the process qualifies the actual punch against the start and end times.
      Note:
      • The AutoShifts_Variables decision table must contain unique rows.

      • Each row added to the AutoShifts_Variables table must contain a sequential SerialNo value.

      • Values in the From and To columns must be entered using 24-hour time format.

      • Values in the From and To columns are included as part of the time span.

      • The maximum To time value is 24:00.

      • The From time value cannot be greater than the To time value.

      • ShiftTemplate and PayRule parameter values must match configured values in UKG Pro Workforce Management; these values are case-sensitive.

      • The employee's pay rule determines the shift template that applies to the span.

      • Multiple Pay Rule column values must be separated with a semicolon. Do not include a semicolon when entering a single pay rule value.

      • Valid entries in the Operator column include: "Equals", "Not equals", "Starts with", "Ends with", and "Contains".

      Auto Shifts Variables table sample content

      Serial NoFrom(HH:mm)To(HH:mm)ShiftTemplatePayRuleOperator
      =="1"0:007:00MA-Early 8Shift Rotation FT40hEquals
      =="2"7:0012:00MA-Early 8Shift Rotation FT40hEquals
      =="3"12:0018:00MA-Early 8Shift Rotation FT40hEquals
      AutoShifts_Location — Defines the explicit day divide associated with a location.

      Auto Shifts — Location decision table structure

      Variable nameDescription
      LocationIdentifies the location for which an explicit day divide is defined.
      Note: The Location variable supports operators like "Contains," "Starts with," "Ends with," and "Is Not Empty."
      Day Divide (HH:mm)Identifies the exact time of the day divide for the Location.
      Caution:

      Must be entered using 24-hour format (HH:mm).

      Important: The last row of the Location table must contain values of !=empty and 00:00 for Location and Day Divide (HH:mm). Do not delete this row.

      Auto Shifts Location table sample content

      LocationDay Divide (HH:mm)
      .contains(West)08:00
      !=empty00:00
      AutoShifts_Locale — Allows customization of labels and messages.

      AutoShifts_Locale decision table structure

      Variable name

      Variable type

      Description

      Key

      String

      Internal field label; do not change.

      LocalePolicy

      String

      Name of the locale policy for which the label applies.

      When the label applies to all locales, keep the empty value.

      Message

      String

      Label displayed on the confirmation form.

      Only applies when DisplayAttestationForm = Yes.

      Description

      String

      (Optional) Additional information.

      Note:
      • Localization of business process workflows remains optional, but is supported.​
      • You can translate some or all messages by adding lines to the table in their preferred translation for specific locales. Decision tables are scanned from top to bottom; therefore, place messages for the most commonly used Locale Policy at the top of the decision table and less-restrictive locale policies at the bottom.
      • Text within tags ("<>") must not be changed.
      • The decision table holds all messages represented with standard English labels; these apply to all locales when the Locale Policy is set to !=empty.
      • Names of the parameters in the decision table column ​Parameter Name must be used as is. If any parameter value needs to be localized for a different Locale Policy, copy the ​Parameter Name​ with the !=empty ​Locale Policy, add a new row to the decision table with the appropriate Locale Policy, and then add the localized value in the Message column.​
      • Decision tables support operators like "Contains," "Starts with," "Ends with," and "Is Not Empty." You can achieve your preferred results by following these examples:
        • To match any non-empty or any string (like *), use the "Is Not Empty" operator.
        • To match a string starting with "ABC" (like "ABC*"), use the "Starts with" operator and set the value to "ABC".
        • To match a string containing "English" as substring, use the "Contains" operator with the value "English".

      Auto Shifts Locale table sample content

      KeyLocale PolicyMessage
      == "_MessageOriginalShiftComment"!= emptyOriginal Shift
      == "_MessageScriptTimeFormatError"!= emptyInvalid time format entered in the decision table.
      == "_MessageShiftTemplateAPIError"!= emptyInvalid shift template entered in the decision table.
      == "_MessageInvalidCommentAPIError"!= emptyComment is not defined in the application.
      == "_MessageEmptyPayruleValidation"!= emptyAn active pay rule must be assigned to the employee.
      == "_MessageShiftTemplateDTValidation"!= emptyEither the In-Punch time does not fall within a configured zone, or the pay rule assigned to the employee does not exist in the decision table.
      == "_MessageRadioYes"!= emptyYes
      == "_MessageRadioNo"!= emptyNo
      == "_MessageInvalidOperatorScriptError"!= emptyThe decision table contains an invalid operator.
      == "_MessageNoLabelandTime"!= emptyWhen DisplayAttestationForm = Yes, either DisplayShiftLabel or DisplayShiftTime must equal Yes.
      == "_MessageScriptError"!= emptyThe script failed to execute. Contact the system administrator.
      == "_MessageSystemAdmin"!= emptyContact the system administrator.
      == "_MessageDisplayError"!= emptyThe error is listed below:
      == "_MessageErrorFormHeader"!= emptyError
      == "_MessageAPIError"!= emptyAPI connector error. Contact the system administrator.
      == "_MessageFormTemplate"!= emptyYour punch (<NewPunchTime>) deviates from your scheduled shift start time. <p>Scheduled Shift: <ShowFormScheduled></p><p>Adjusted Shift: <ShowFormProposed></p><Change my shift
  3. Deploy the updated Auto Shifts business process model
    Note: Process models must be redeployed every time changes are made to an existing model. Re-deployment is not required for decision table changes.
    1. Go to Main Menu > Administration > Application Setup > Business Process setup > Process Models.

    2. Select the AutoShifts_v3 model and click Deploy.

    3. On the Business Process page, configure the required parameters and deployment dates.

      • (Optional) In Description, enter Auto Shifts.

      • In Display Name, enter AutoShifts_v3.

      • In Start Effective, select the effective start date.

      • In End Effective, select Forever to make the Business Process available indefinitely.

      • In Status, select Active.

      • In Action List, select Hide.

      • In Tile List, select Hide.

      • In GoTo List, select Hide.

      • From Template Categories, select Attestation.

    4. Click Save and then Return.

APIs

API details

API name

Section

Type

Resource path

Description

Retrieve Person by Extension

Commons

GET

/v1/commons/persons/{extensionType}

Retrieve an employee's payrule information.

Retrieve Timecard as Manager

Timekeeping

GET

/v1/timekeeping/timecard?select=PUNCHES&start_date={YYYY-MM-DD}&end_date={YYYY-MM-DD}&person_number={}

Retrieve an employee's punch details for the specified date range.

Retrieve Shift Template by Name

Scheduling

GET

/v1/scheduling/shift_templates?name={}

Retrieve shift details.

Retrieve Employee Schedule

Scheduling

GET

/v1/scheduling/employee_schedule

Retrieve an employee's shift information for the specified date.

Delete Shift by ID

Scheduling

DELETE

/v1/scheduling/schedule/shifts/{shiftId}

Delete an existing shift.

Create Shifts from Patterns

Scheduling

POST

v1/scheduling/schedule/shifts/apply_create

Create a new shift.

Update Shift by ID

Scheduling

POST

/v1/scheduling/schedule/shifts/{}

Update a shift.

Version history

VersionDescription
1.0Initial release.
2.0The extension now supports clock devices and the single punch button.
2.1Discrepancies that occurred when In and Out punches crossed the day divide were resolved.
3.0This extension now offers a mechanism to explicitly define the day divide for a location. Beginning with version 3.0, shifts are no longer automatically split at midnight. Instead, when a shift spans the day divide, it correctly identifies the configured zone boundaries that align with the pay rule assigned to the employee.