IbmAddTask

Use this script to add a task to an IBM QRadar SOAR incident.

python · IBM Security QRadar SOAR

Details

IDIbmAddTask
Languagepython
From Version6.10.0
Docker Imagedemisto/python3:3.12.13.10404775

README

Use this script to add a task to an IBM QRadar SOAR incident.

Script Data


Name Description
Script Type python3
Cortex XSOAR Version 6.8.0

Dependencies


This script uses the following commands and scripts.

  • IBM Resilient Systems
  • rs-add-custom-task

Inputs


Argument Name Description
name Task name.
description Task description.
instructions Textual instructions for the task. This will override the default instructions for the task.
due_date Task due date in ISO format e.g., “2020-02-02T19:00:00Z. Empty date indicates that the task has no assigned due date.
owner_id The owner of the task (ID or name as appears in IBM QRadar SOAR). Leave empty if the task has no owner.
phase Task to be added to the IBM QRadar incident.

Outputs


There are no outputs for this script.

import demistomock as demisto
from IbmAddTask import add_task


def test_add_task(mocker):
    """Test if the correct arguments are given to the CommandResults object when
    adding a task.
    """
    mocker.patch.object(demisto, "executeCommand", return_value=[{"HumanReadable": "New task created"}])

    mocker.patch.object(demisto, "incident", return_value={"dbotMirrorId": "123"})

    result = add_task(
        {
            "name": "New Task",
            "phase": "Initial",
            "due_date": "2023-06-01",
            "description": "Task description",
            "instructions": "Task instructions",
            "tags": "FROM XSOAR",
        }
    )

    assert "New task created" in result.readable_output
    assert "New Task" in result.readable_output
    assert "Initial" in result.readable_output
    assert "2023-06-01" in result.readable_output
    assert "Task description" in result.readable_output
    assert "Task instructions" in result.readable_output
    assert result.tags == ["FROM XSOAR"]
    assert not result.mark_as_note