ShowCampaignIncidentsOwners

Displays all the campaign incident owners and their quantity. This automation runs using the default Limited User role, unless you explicitly change the permissions. For more information, see the section about permissions here: - For Cortex XSOAR 6 see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.x/Cortex-XSOAR-Playbook-Design-Guide/Automations - For Cortex XSOAR 8 Cloud see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Create-a-script - For Cortex XSOAR 8.7 On-prem see https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8.7/Cortex-XSOAR-On-prem-Documentation/Create-a-script

python · Phishing Campaign

Details

IDShowCampaignIncidentsOwners
Languagepython
From Version6.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Tagsdynamic-section

README

Displays all the campaign incident owners and their quantity.

This automation runs using the default Limited User role, unless you explicitly change the permissions.
For more information, see the section about permissions here:
For Cortex XSOAR 6, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/6.x/Cortex-XSOAR-Playbook-Design-Guide/Automations for Cortex XSOAR 8 Cloud, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8/Cortex-XSOAR-Cloud-Documentation/Create-a-script for Cortex XSOAR 8 On-prem, see the https://docs-cortex.paloaltonetworks.com/r/Cortex-XSOAR/8.7/Cortex-XSOAR-On-prem-Documentation/Create-a-script.

Script Data


Name Description
Script Type python3
Tags dynamic-section
Cortex XSOAR Version 6.0.0

Inputs


There are no inputs for this script.

Outputs


There are no outputs for this script.

import demistomock as demisto
import ShowCampaignIncidentsOwners


def demisto_execute_command(command, args):
    return [{"Contents": '[{"owner": "owner_1"}, {"owner": "owner_2"}]', "Type": 3}]


def test_show_incident_owners(mocker):
    """
    Given:
        - Incident IDs.
    When:
        - Running the show owners script main function.
    Then:
        - Ensure all the owners appear in the html result.
    """
    mocker.patch.object(ShowCampaignIncidentsOwners, "get_incident_ids", return_value=["1", "2"])
    mocker.patch.object(demisto, "incident", return_value={"owner": "admin"})
    mocker.patch.object(demisto, "executeCommand", side_effect=demisto_execute_command)
    mocker.patch.object(demisto, "results")

    ShowCampaignIncidentsOwners.main()
    res = demisto.results.call_args[0][0]["Contents"]

    assert "admin" in res
    assert "owner_1" in res
    assert "owner_2" in res