Skip to main content


This Script is part of the Developer Tools Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.1.0 and later.

Wait and complete tasks by given status. Used for test playbooks.

Script Data#

Script Typepython3
Cortex XSOAR Version6.1.0


Argument NameDescription
task_statesA comma separated list of states. Possible values: New, InProgress, Completed, Waiting, Error, Skipped, Blocked (leave empty to get all tasks).
complete_optionOutcome for a conditional task. For example, "Yes".
incident_idThe incident ID where the task should be completed. Leave empty to use current incident ID.
task_nameThe name of the task that should be completed. If no task name is entered, will complete all tasks with the state task_state.
max_timeoutTimeout in seconds for the script to complete tasks.
interval_between_triesTime (seconds) to wait between each check iteration.
complete_taskWhether to complete the task in addition to checking if it is completed.


WaitAndCompleteTask.CompletedTaskTask name that was completed by the script.String
WaitAndCompleteTask.FoundTaskTasks that were found by the script.Unknown

Script Examples#

Example command#

!WaitAndCompleteTask incident_id=6209 task_states=Waiting complete_task=true

Context Example#

"WaitAndCompleteTask": {
"CompletedTask": [
"Conditional task",
"manual task 1"
"FoundTask": []

Human Readable Output#

Completed TaskFound Task
Conditional task,
manual task 1