SendCPAction

Send quarantine or restore action and update action task id.

python · Check Point Harmony Email and Collaboration (HEC)

Details

IDSendCPAction
Languagepython
From Version6.9.0
Docker Imagedemisto/python3:3.12.13.10116658

README

Send quarantine or restore action and update action task id.

Script Data


Name Description
Script Type python3
Cortex XSOAR Version 6.9.0

Dependencies


This script uses the following commands and scripts.

  • checkpointhec-send-action
  • CheckPointHEC

Inputs


Argument Name Description
entity Email entity id.
action Action name.

Outputs


There are no outputs for this script.

import demistomock as demisto
from SendCPAction import send_action_and_update_incident


def test_send_action_and_update_incident(mocker):
    def execute_command(name, args):
        if name == "checkpointhec-send-action":
            return [{"Contents": {"task": 1}}]

        if name == "setIncident":
            return None

        raise ValueError(f"Error: Unknown command or command/argument pair: {name} {args!r}")

    mocker.patch.object(demisto, "executeCommand", side_effect=execute_command)

    result = send_action_and_update_incident("0000", "quarantine", "CheckPointHEC-instance-1")
    assert result == [{"Contents": {"task": 1}}]