Manage Allocated Tasks
You can allocate tasks in a checklist to different task performers. For example, in an onboarding checklist, you can allocate tasks to representatives in IT, finance, benefits, and payroll. When tracking the tasks, you may want to get the details of all the tasks assigned to a specific worker and update, delete, or reopen a completed task. You can use the allocatedTasks
resource to manage the allocated tasks.
Let's discuss these scenarios:
- Get all the tasks allocated to a worker
- Update the status of a task in an allocated checklist
- Reopen a completed task in an allocated checklist
- Delete a task from an allocated checklist
Here's a typical application processing flow for the scenarios:
- You configure checklists and allocate tasks according to your organizational needs.
- You query the task and identify the people to whom the task is to be allocated.
- When you allocate a task or make changes to an allocated task, the application makes a REST service call to Oracle HCM Cloud and returns appropriate data.
Get All the Allocated Tasks
Let's say that Gretchen wants to know how many tasks she has assigned to Jason. She uses Jason's person number to get all the tasks assigned to him.
To get all the tasks in an allocated checklist:
- Query the person by using a query parameter such as person number (for example, /allocatedChecklists?q=PersonId=100100100011) and retrieve (GET) the collection URL.
- Verify the task details returned in the response.
Example URL
Use this resource URL format.
GET
/hcmRestApi/resources/11.13.18.05/allocatedChecklists/{allocatedChecklistsUniqID}/child/allocatedTasks
Example Response
Here's an example of the response body in JSON format.
{
"items": [
{
"ActionType": null,
"ActionURL": null,
"ActualEndDate": null,
"ActualStartDate": null,
"AllocatedChecklistId": 300100031447538,
"AllocatedTaskId": 300100031447539,
"Description": null,
"TaskActionCode": null,
"TaskName": "ASSIGN DRESS",
"DependentOnTasks": null,
"Status": "INI",
"MandatoryFlag": true,
"TaskSequence": null,
"TargetEndDate": null,
"TargetStartDate": "2013-12-10",
"TaskOwnerName": "Timothy Watson",
"TaskOwnerPersonId": 100010024200674,
"TaskOwnerUsername": "PAY_MGR_ALL",
"ResponsibilityType": null,
"ResponsibilityTypeGUID": null,
"PerformerOrigSystemId": null,
"PerformerOrigSystem": null,
"OwnerRespType": null,
"OwnerRespTypeUsers": null,
"TaskInChecklistId": 300100013625539,
"TaskConfiguration": null,
"FlexContextCode": null,
"CompletedBy": null,
"CompletionDate": null,
"TargetDurationUOM": null,
"AbsAllocatedChecklistId": null,
"DetailAllocChecklistId": null,
"links": [
{.....}
]
}
]
}
Update the Task Status
Gretchen wants to update the status of a task that Jason completed in the checklist that she allocated to him.
To update the status of a task in an allocated checklist:
- Query the task using the query parameter
taskName
. - Perform a POST operation on the
allocatedTasks
resource, providing the new status to be updated in the request body.
Example URL
Use this resource URL format.
POST
/hcmRestApi/resources/11.13.18.05/allocatedChecklists/{allocatedChecklistsUniqID}/child/allocatedTasks/{AllocatedTaskId}/action/updateTaskStatus
Example Request
Here's an example of the request body in JSON format.
{
"status": "COM"
}
Example Response
Here's an example of the response body in JSON format.
The task action was successful. (PER-1532320)
Reopen a Completed Task
Gretchen forgot that her company now asks employees to take a business ethics class as part of the onboarding process. She wants to reopen a completed task in the checklist that she allocated to Jason, to add this additional step.
To reopen a completed task:
- Query the completed task which needs to be reopened using the query parameter
taskName
. - Perform a POST operation on the
allocatedTasks
resource. - Verify that the allocated task appears in the Incomplete Tasks section for the worker in Oracle HCM Cloud UI.
Example URL
Use this resource URL format.
POST
/hcmRestApi/resources/11.13.18.05/allocatedChecklists/{allocatedChecklistsUniqID}/child/allocatedTasks/{AllocatedTaskId}/action/reopenTask
Example Response
Here's an example of the response body in JSON format.
The task action was successful. (PER-1532320)
Delete an Allocated Task
When reviewing the progress of tasks in an onboarding checklist assigned to Jason, Gretchen decides to delete a task that's no longer required.
To delete a task from an allocated checklist:
- Query (GET) the worker and identify the task to be deleted by using query parameters (for example, /allocatedChecklists?q=PersonNumber=100100100011).
- Perform a DELETE operation on the URL for the specific checklist. You don't need a payload for this operation.
- Verify that the allocated task is deleted for the worker in Oracle HCM Cloud UI.
Example URL
Use this resource URL format.
DELETE
/hcmRestApi/resources/11.13.18.05/allocatedChecklists/{allocatedChecklistsUniqID}/child/allocatedTasks/{AllocatedTaskId}
Example Response
Here's an example of the response body in JSON format.
204 - No content