Getting Error when trying to make REST API PATCH Call to update assignment status
Summary:
We are trying to update assignment status to "Inactive - No Payroll" from "Inactive - Payroll Eligible" and I get this error
{
"title": "Bad Request",
"status": "400",
"o:errorDetails": [
{
"detail": "You can't make the assignment inactive by updating the assignment status. You must perform a valid operation to inactivate the assignment. (PER-1532276)",
"o:errorCode": "PER:::PER_INVALID_INACTIVE_ASGN"
}
]
}
My PATCH call URL ⇒ {{BaseURL}}/hcmRestApi/resources/latest/workers/{WorkerId}/child/workRelationships/{PeriodOfServiceId}/child/assignments/{AssignmentId}
Payload ⇒ {
"ActionCode": "ASG_CHANGE",
"ReasonCode": "OTHER",
"AssignmentStatusTypeCode": "INACTIVE_NO_PROCESS"
}
The same thing if I try to do in the UI ( just change the assignment status) , it works. I don't get any error.