Employee Job Preferences

Job preferences allow you to define and assign an order to the jobs on the Business Structure that each employee prefers.

You can assign, update, delete, and retrieve details about employee job preferences using operations against the /v1/commons/persons/job_preferences 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 job preferences.

Create the assignment

The create request:

  • uses personNumber to identify the person using their person number
  • uses the employeeJobPreferences object to define the job preferences to assign

Example request

Call PUT /v1/commons/persons/job_preferences with the following request payload.

{
  "personNumber": "20190",
  "employeeJobPreferences": [
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/RN",
      "preference": "5"
    },
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/NP-PA",
      "preference": "1"
    }
  ]
}

Example response

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

{
  "effectiveDate": "2020-09-14",
  "employeeJobPreferences": [
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/RN",
      "preference": "5"
    },
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/NP-PA",
      "preference": "1"
    }
  ],
  "personNumber": "20190"
}

Verify the assignment

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

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

{
    "employeeJobPreferences": [
        {
            "job": "MD",
            "preference": "NO PREFERENCE"
        },
        {
            "job": "NP-PA",
            "preference": "1"
        },
        {
            "job": "RN",
            "preference": "5"
        },
        {
            "job": "Tech",
            "preference": "NO PREFERENCE"
        },
        {
            "job": "Receptionist",
            "preference": "NO PREFERENCE"
        }
    ]
}

Update the assignment

You can perform a full replacement update by calling PUT /v1/commons/persons/job_preferences or a partial update (essentially a PATCH) by calling PUT /v1/commons/persons/job_preferences?updatePartial=true.

The request payload structure matches the create example.

Delete an assignment

To delete a person's job preferences, call PUT /v1/commons/persons/job_preferences and remove the unwanted job preferences from the request.

For our example, to remove the RN job preference, submit the following request payload.

Example request

{
  "personNumber": "20190",
  "employeeJobPreferences": [
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/NP-PA",
      "preference": "1"
    }
  ]
}

Example response

{
  "effectiveDate": "2020-09-14",
  "employeeJobPreferences": [
    {
      "job": "Health System/Non Acute Clinics/Clinics/Mid-Atlantic/VA/Arlington/Clinical/NP-PA",
      "preference": "1"
    }
  ],
  "personNumber": "20190"
}