Change task assignment state

Guides Tasks Assigning tasks Change task assignment state
Edit this page

Change task assignment state

To update a task assignment's state call the PUT /tasks/:task_id/assignments API and include a resolution_state, such as completed, incomplete, approved, or rejected.

cURL
curl -i -X PUT "https://api.box.com/2.0/task_assignments/12345" \
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "message": "New message",
       "resolution_state": "completed"
     }'
Java
String assignmentID = "12345";
BoxTaskAssignment taskAssignment = new BoxTaskAssignment(api, assignmentID);
BoxTaskAssignment.Info info = taskAssignment.getInfo();
info.setResolutionState(BoxTaskAssignment.ResolutionState.APPROVED);
taskAssignment.updateInfo(info);
Python
from boxsdk.object.task_assignment import ResolutionState
updated_task = {'resolution_state': ResolutionState.APPROVED}
updated_assignment = client.task_assignment(assignment_id='12345').update_info(updated_task)
print('Assignment ID is {0} and resolution state is {1}'.format(updated_assignment.id, updated_assignment.resolution_state))

Resolution states

Box currently supports two types of tasks defined by the action value: review tasks and complete tasks.

The type of task determines the possible resolution states a task can be in and the interface shown to a user in the web and mobile apps.

Task actionPossible resolution states
reviewincomplete, approved, rejected
completeincomplete, complete

A review task starts out in an incomplete state and can be marked as incomplete, approved, or rejected. In the user interface a user is provided with a text box and an pair of buttons to approve or reject the task.

A complete task starts out in an incomplete state and can be marked incomplete or completed. Once a this task is marked completed, no further changes can be made to the task's state. In the user interface a user is provided with a text box and an button to mark the task as completed.