Task Assignment: Assigning tasks to projects
- Get all tasks assigned to a given project
- Get one task assignment
- Assign a task to a project
- Create a new task and assign it to a project
- Removing a task from a project
- Changing a task for a project
Get all tasks assigned to a given project
GET /projects/#{project_id}/task_assignments
HTTP Response: 200 OK
<task-assignments> <task-assignment> <id type="integer">23</id> <project-id type="integer">3</project-id> <task-id type="integer">2878</task-id> <!-- True if task is billable for this project --> <billable type="boolean">true</billable> <!-- True if task was deactivated for project, preventing further hours to be logged against it --> <deactivated type="boolean">true</deactivated> <!-- The budget (if present) for the task in project --> <budget type="decimal">80</budget> <!-- The hourly rate (if present) for the task in project --> <hourly-rate type="decimal">80</hourly-rate> <updated-at type="datetime">2008-04-09T12:07:56Z</updated-at> <created-at type="datetime">2008-04-09T12:07:56Z</created-at> </task-assignment> <task-assignment> ... </task-assignment> </task-assignments>
You filter by updated_since. To show only the task assignments that have been updated since "2010-09-25 18:30", pass the UTC date time value (URL encoded).
GET /projects/#{project_id}/task_assignments?updated_since=2010-09-25+18%3A30
HTTP Response: 200 Success
Get one task assignment
GET /projects/#{project_id}/task_assignments/#{task_assignment_id}
HTTP Response: 200 OK
<task-assignment> <id type="integer">23</id> <project-id type="integer">3</project-id> <task-id type="integer">2878</task-id> <!-- True if task is billable for this project --> <billable type="boolean">true</billable> <!-- True if task was deactivated for project, preventing further hours to be logged against it --> <deactivated type="boolean">true</deactivated> <!-- The budget (if present) for the task in project --> <budget type="decimal">80</budget> <!-- The hourly rate (if present) for the task in project --> <hourly-rate type="decimal">80</hourly-rate> <updated-at type="datetime">2008-04-09T12:07:56Z</updated-at> <created-at type="datetime">2008-04-09T12:07:56Z</created-at> </task-assignment>
Assign a task to a project
POST /projects/#{project_id}/task_assignments
HTTP Response: 201 CreatedLocation: /projects/#{project_id}/task_assignments/#{new_task_assignment_id}
You will have to post the following:
<task> <id type="integer">653425</id> </task>
Create a new task and assign it to a project
POST /projects/#{project_id}/task_assignments/add_with_create_new_task
HTTP Response: 201 CreatedHTTP Response: 201 CreatedLocation: /projects/#{project_id}/task_assignments/#{new_task_assignment_id}
You will have to post the following:
<task> <name>Backend Development</name> </task>
Removing a task from a project
DELETE /projects/#{project_id}/task_assignments/#{task_assignment_id}
HTTP Response: 200 OKNote that Harvest requires one task per project.
Harvest will not remove the task if it has recorded hours against the project. Instead we will archive the assignment. Harvest will reply with a custom Hint header if archiving occurred.
Changing a task for a project
PUT /projects/#{project_id}/task_assignments/#{task_assignment_id}
HTTP Response: 200 Success
You will have to post the following:
<task-assignment> <billable type="boolean">true</billable> <deactivated type="boolean">false</deactivated> <budget type="decimal">3234</budget> <hourly-rate type="decimal">100</hourly-rate> </task-assignment>