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
The unique identifier for the project. You can find the project ID in the user interface or retrieve it using the
list_projectsfunction.
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)
NumberRange
Defines filtering rules for numeric task fields.
Parameters:
eq: int or float, Optional
Matches tasks where the field value is exactly equal to the specified number.
Example:
NumberRange(eq=10)
ne: int or float, Optional
Matches tasks where the field value is not equal to the specified number.
Example:
NumberRange(ne=0)
gt: int or float, Optional
Matches tasks where the field value is greater than the specified number.
Example:
NumberRange(gt=5)
gte: int or float, Optional
Matches tasks where the field value is greater than or equal to the specified number.
Example:
NumberRange(gte=100)
lt: int or float, Optional
Matches tasks where the field value is less than the specified number.
Example:
NumberRange(lt=3.5)
lte: int or float, Optional
Matches tasks where the field value is less than or equal to the specified number.
Example:
NumberRange(lte=25)
DateRange
Defines filtering rules for date and time–based task fields.
Parameters:
gt: datetime, Optional
Matches tasks where the field value is later than the specified date and time.
Example:
DateRange(gt=datetime(2024, 1, 1))
gte: datetime, Optional
Matches tasks where the field value is later than or equal to the specified date and time.
Example:
DateRange(gte=datetime(2024, 1, 1, 12, 0))
lt: datetime, Optional
Matches tasks where the field value is earlier than the specified date and time.
Example:
DateRange(lt=datetime(2024, 12, 31, 23, 59, 59))
lte: datetime, Optional
Matches tasks where the field value is earlier than or equal to the specified date and time.
Example:
DateRange(lte=datetime(2024, 6, 30))
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