requeue_tasks

imerit_ango.sdk.SDK.

requeue_tasks(project_id, to_stage_id, filters, options)

Requeue tasks from one stage to another within a project. This function gives you control over which tasks are moved and how they are requeued.

Parameters

  • project_id: string

  • to_stage_id: string

    • The identifier of the target stage to which the tasks will be requeued. This stage must exist within the specified project.

  • filters: dict, default None

    • Criteria to select which tasks should be requeued. If no filters are provided, all tasks will be requeued.

      • taskIds: List[str]

        • List of task IDs

      • externalIds: List[str]

        • List of external IDs

      • assetIds: List[str]

        • List of asset IDs

      • fromStageIds: List[str]

        • List of stage IDs from which tasks should be requeued

  • options: dict, default None

    • Settings that customize how tasks are requeued. Supported options:

      • removeAnnotations: bool

        • Remove existing annotations before requeuing.

      • removeAssignee: bool

        • Unassign the current assignee from the task.

      • removeStageHistory: bool

        • Clear the task’s stage history.

Returns:

  • output: dict

    • A dictionary containing the result of the operation.

Example

Requeue all the tasks to the specified stage from other stages

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

stage_id = '<YOUR STAGE ID>'
sdk_response = ango_sdk.requeue_tasks(project_id=project_id, to_stage_id=stage_id)

Requeue specific tasks only

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

stage_id = '<YOUR STAGE ID>'
external_id_list = ["<EXTERNAL ID 1>", "<EXTERNAL ID 2>", "<EXTERNAL ID 3>"]

sdk_response = ango_sdk.requeue_tasks(project_id=project_id, 
                                      to_stage_id=stage_id, 
                                      filters={"externalIds": external_id_list})

Requeue tasks with configurable preferences

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

stage_id = '<YOUR STAGE ID>'

sdk_response = ango_sdk.requeue_tasks(project_id=project_id, 
                                      to_stage_id=stage_id, 
                                      options={"removeAnnotations":True,
                                               "removeAssignee": True,
                                               "removeStageHistory": True})

See also

get_project

Last updated