Schedule Group Assignments

Schedule groups organize employees who share characteristics such as schedules into groups that make their schedules easier to manage. When you create schedule groups, you can assign schedules and schedule entities to all members of the group.

There are two types of groups, groups with inheritance and groups without inheritance.

  • Groups with no inheritance simply make it easier to view a certain set of employees separately from other employees. The only impact is in the sequence of the list of employees and the ability to collapse the list.
  • Groups With Inheritance make it easier to create and modify employee schedules in unison. When you apply a pattern, a shift, a paycode, or an availability status to a group with inheritance, that entity appears in the schedule of all the employees in the group. That entity can be modified or removed from the schedule of all employees with a single command. Individual shifts, paycodes, and availability can also be defined for specific employees at specific times. These entities are not inherited and must be managed at the employee level.

If you modify the schedule of individual employees in a group, the modified entity is un-linked from the group and will no longer be affected by any modification of the original group-based entity.

You can assign, update, delete, and retrieve details about schedule group assignments using operations against the /v1/commons/persons/schedule_groups resource.

Prerequisites

A person's person ID is the same as the personKey and employee ID, and is not the same as the person number.

The person in this example has a person ID of 100 and a person number of 20190.

Example

In this example, we assign, verify, update, and delete a person's schedule group assignments.

Create the assignment

The create request:

  • uses personIdentity to identify the person using their person number
  • uses the assignments array to define the schedule groups to assign
  • uses scheduleGroup to define each schedule rule set
  • uses effectiveDate and expirationDate to define the effective date and expiration date of each assignment

Example request

Call POST /v1/commons/persons/schedule_groups with the following request payload.

{
    "personIdentity": {
        "personNumber": "20190"
    },
    "assignments": [
        {
            "scheduleGroup": {
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-01-06",
            "expirationDate": "3000-01-01"
        }
    ]
}

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

{
    "personIdentity": {
        "personNumber": "20190",
        "personKey": 100
    },
    "assignments": [
        {
            "scheduleGroup": {
                "id": 51,
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-01-06",
            "expirationDate": "3000-01-01"
        }
    ]
}

Verify the assignment

To verify, call GET /v1/commons/persons/schedule_groups?person_number={personNumber} or GET /v1/commons/persons/schedule_groups/{personId}.

Calling GET /v1/commons/persons/schedule_groups?person_number=20190 or GET /v1/commons/persons/schedule_groups/100 returns:

{
    "personIdentity": {
        "personNumber": "20190",
        "personKey": 100
    },
    "assignments": [
        {
            "scheduleGroup": {
                "id": 51,
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-01-06",
            "expirationDate": "3000-01-01"
        }
    ]
}

Update the assignment

To update the person's schedule group assignments, call PUT /v1/commons/persons/schedule_groups with the following request payload.

Example request

{
    "personIdentity": {
        "personNumber": "20190"
    },
    "assignments": [
         {
            "scheduleGroup": {
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-02-10",
            "expirationDate": "2020-02-14"
        },
        {
            "scheduleGroup": {
                "qualifier": "Team B"
            },
            "effectiveDate": "2020-02-17",
            "expirationDate": "2020-02-21"
        }
    ]
}

Example response

{
    "personIdentity": {
        "personNumber": "20190",
        "personKey": 100
    },
    "assignments": [
        {
            "scheduleGroup": {
                "id": 52,
                "qualifier": "Team B"
            },
            "effectiveDate": "2020-02-17",
            "expirationDate": "2020-02-21"
        },
        {
            "scheduleGroup": {
                "id": 51,
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-02-10",
            "expirationDate": "2020-02-14"
        }
    ]
}

Delete an assignment

To delete one of the schedule group assignments associated with a person, call POST /v1/commons/persons/schedule_groups/apply_delete with the following request payload.

{
    "personIdentity": {
        "personNumber": "20190"
    },
    "assignments": [
         {
            "scheduleGroup": {
                "qualifier": "Team A"
            },
            "effectiveDate": "2020-02-10",
            "expirationDate": "2020-02-14"
        }
    ]
}

The system returns HTTP status 204 with no response body. The delete operation can be confirmed by following the verification procedure, which confirms that the Team A assignment was successfully deleted:

{
    "personIdentity": {
        "personNumber": "20190",
        "personKey": 100
    },
    "assignments": [
        {
            "scheduleGroup": {
                "id": 52,
                "qualifier": "Team B"
            },
            "effectiveDate": "2020-02-17",
            "expirationDate": "2020-02-21"
        }
    ]
}