get_tasks

imerit_ango.sdk.SDK.

get_tasks(project_id, page, limit, status, stage, batches, include_answer, task_filter, sort, fields)

Retrieve detailed information for tasks.

Tasks in projects are paginated. A maximum of 1000 items per page can be obtained. See the code snippets below for an example of how to download all tasks from a project by flipping through the pages.

Parameters

  • project_id: string

  • page: integer, default 1

    • Current page.

    • Example: 1

  • limit: integer, default 10

    • Page size. Default 10, maximum 1000.

    • Example: 100

  • status: string, default None, {None, "TODO", "Completed"}

    • Filter tasks by status.

    • Example: 'Completed'

  • stage: string, default None

    • Pass a stage ID to filter tasks by stage. You can obtain a stage's ID by running get_export(project_id)on the project where you'd like to get the stage IDs.

    • Example: 'Label' or "1a1a2d88-ddad-457a-aac8-fe50a3a65272"

  • batches: list[str], default None

    • Filter tasks by batch (e.g., only get tasks belonging to the batch specified)

    • Example: ['batch_1', 'batch_2']

  • include_answer: bool, default False

    • If set to True, the response will contain answer data (e.g., annotations) for each task.

  • task_filter: TaskFilter, Optional

    • Applies advanced filtering rules to narrow down the returned tasks.

    • Example: TaskFilter(stage=["Completed"])

  • sort: string, Optional

    • Specifies sorting rules for the returned tasks.

    • Example: "-externalId"

  • fields: string, Optional

    • Limits the response to only the specified task fields.

    • Example: "externalId,createdBy,createdAt"


TaskFilter class

Defines a structured and expressive way to filter tasks.

  • stage: List[str] or StringFilter

    • Filters tasks by workflow stage.

  • batches: List[str] or StringFilter

    • Filters tasks by batch identifiers.

  • status: TaskStatus, string, StringFilter

    • Filters tasks by status of tasks.

  • review_status: ReviewStatus, string, StringFilter

    • Filters tasks by review outcome.

  • task_type: TaskType, string, StringFilter

    • Filters tasks by type.

  • assignee: string or StringFilter

    • Filters tasks by assignee.

  • external_id: string or StringFilter

    • Filters tasks by external ID.

  • created_at: DateRange

    • Filters tasks based on creation timestamp.

  • updated_at: DateRange

    • Filters tasks based on last update timestamp.

  • created_by: string or StringFilter

    • Filters tasks by the user who created them.

  • updated_by: string or StringFilter

    • Filters tasks by the user who last updated them.

  • priority: int or NumberRange

    • Filters tasks by priority level.

  • duration: NumberRange

    • Filters tasks by the duration of the current stage (in seconds).

  • total_duration: NumberRange

    • Filters tasks by total accumulated duration across all stages (in seconds).

  • open_issues_count: int or NumberRange

    • Filters tasks by the number of open issues.

  • is_draft: bool

    • Filters tasks based on draft status.

  • is_skipped: bool

    • Filters tasks that were skipped during processing.

  • is_benchmark: bool

    • Filters benchmark tasks.

StringFilter

Defines filtering rules for string-based task fields.

Parameters:

  • eq: string, Optional

    • Matches tasks where the field value is exactly equal to the specified string.

    • Example: StringFilter(eq="completed")

  • ne: string, Optional

    • Matches tasks where the field value is not equal to the specified string.

    • Example: StringFilter(neq="draft")

  • regex: string, Optional

    • Matches tasks where the field value satisfies the given regular expression.

    • Example: StringFilter(regex="^batch_.*")

  • in_list: List[string], Optional

    • Matches tasks where the field value is included in the provided list of strings.

    • Example: StringFilter(in_list=["batch-1", "batch-2"])

  • nin: List[string], Optional

    • Matches tasks where the field value is not included in the provided list of strings.

    • Example: StringFilter(nin=["batch-1", "batch-2"])

  • exists: bool, Optional

    • Matches tasks based on whether the field exists or is defined.

    • Example: StringFilter(exists=True)

Each field is optional. You may specify one or more filters depending on your use case.

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

Example

Retrieve the first ten tasks from the project:

Retrieve all tasks from the project:

Last updated