Employee Tag Assignments - Aggregated

Tags provide additional information about a shift segment or a date cell in the schedule. Depending on the configuration, a tag can specify a work rule condition that the Scheduler considers, or a tag can specify no work rule and serve only as a visual reference for the manager.

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 employee tag assignments.

Create or update assignments

The create request:

  • uses personIdentity to identify the person using their person number
  • uses the assignments array to define the employee tags to assign
  • uses effectiveDate and expirationDate to define the effective date and the expiration date of the assignment

Example request

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

[
  {
    "personIdentity": {
      "personNumber": "20190"
    },
    "personAssignments": {
      "employeeTags": {
        "assignments": [
          {
            "employeeTag": {
              "qualifier": "EmployeeTag1"
            },
            "effectiveDate": "2020-02-20",
            "expirationDate": "2020-06-25"
          }
        ]
      }
    }
  }
]

Example response

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

[
  {
    "personIdentity": {
      "personNumber": "20190"
    },
    "personAssignments": {
      "employeeTags": {
        "assignments": [
          {
            "employeeTag": {
              "id": 151,
              "qualifier": "EmployeeTag1"
            },
            "effectiveDate": "2020-02-20",
            "expirationDate": "2020-06-25"
          }
        ]
      }
    }
  }
]

Verify assignments

You can use the bulk multi-read operation to verify assignments for multiple people at once.

Example request

To verify, call POST /v1/commons/persons/assignments/multi_read with the following request payload.

{
  "where": {
    "employees": {
      "key": "personNumber",
      "values": [
        "20190"
      ]
    },
    "personAssignments": [
      "employeeTags"
    ]
  }
}

Example response

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

[
  {
    "personIdentity": {
      "personNumber": "20190"
    },
    "personAssignments": {
      "employeeTags": {
        "assignments": [
          {
            "employeeTag": {
              "id": 151,
              "qualifier": "EmployeeTag1"
            },
            "effectiveDate": "2020-02-20",
            "expirationDate": "2020-06-25"
          }
        ]
      }
    }
  }
]

Delete assignments

You can delete, or unassign, assignments. To delete our example's assignments, call POST /v1/commons/persons/assignments/multi_upsert using the unAssignExisting property.

Example request

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

[
    {
        "personIdentity": {
            "personNumber": "20190"
        },
        "personAssignments": {
            "employeeTags": {
                "unAssignExisting":true
            }
        }
    }
]

Example response

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

[
  {
    "personIdentity": {
      "personNumber": "20190"
    },
    "personAssignments": {
      "employeeTags": {
        "assignments": []
      }
    }
  }
]

Note: You can verify that the assignments were deleted by calling POST /v1/commons/persons/assignments/multi_read with a request payload specifying all of the affected person identities.