Tasks endpoint

Tasks documentation

Fetch all tasks

tasks(project_id[, params = None])
Parameters:
  • project_id (str) – ID of the project

  • params (dict) – (optional) Request parameters

Returns:

Collection of tasks

Example:

tasks = client.tasks('123.abc', {
    "page": 2,
    "limit": 3,
    "filter_statuses": "completed"
})
tasks.items[0].task_id # => 89334

Fetch a task

task(project_id, task_id)
Parameters:
  • project_id (str) – ID of the project

  • task_id (int or str) – ID of the task to fetch

Returns:

Task model

Example:

task = client.task('123.abc', 89334)
task.task_id # => 89334
task.title # => "Demo task"

Create a task

create_task(project_id, params)
Parameters:
  • project_id (str) – ID of the project

  • params (dict) – Task parameters

Returns:

Task model

Example:

task = client.create_task('123.abc', {
    "title": "Python task",
    "languages": [{
        "language_iso": "en",
        "users": [203]
    }],
    "keys": [340891],
    "auto_close_task": True
})
task.project_id # => '123.abc'
task.title # => "Python task"
task.languages[0]['language_iso'] # => "en"
task.auto_close_task # => True

Update a task

update_task(project_id, task_id[, params = None])
Parameters:
  • project_id (str) – ID of the project

  • task_id (int or str) – ID of the task to update

  • params (dict) – Task parameters

Returns:

Task model

Example:

task = client.update_task('123.abc', 34567, {
    "title": "Python updated task",
    "due_date": "2020-08-24 23:59:59"
})
task.title # => "Python updated task"
task.due_date # => "2020-08-24 21:59:59 (Etc/UTC)"

Delete a task

delete_task(project_id, task_id)
Parameters:
  • project_id (str) – ID of the project

  • task_id (int or str) – ID of the task to delete

Returns:

Dictionary with the project ID and “task_deleted”: True

Example:

client.delete_task('123.abc', 34567)