Skip to main content

GetIncidentsByQuery

This Script is part of the Base Pack.#

Gets a list of incident objects and the associated incident outputs that match the specified query and filters. The results are returned in a structured data file.

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#


NameDescription
Script Typepython3
Tagsml
Cortex XSOAR Version5.0.0

Used In#


This script is used in the following playbooks and scripts.

  • DBot Create Phishing Classifier V2

Inputs#


Argument NameDescription
queryAdditional text by which to query incidents.
incidentTypesA comma-separated list of incident types by which to filter.
fromDateThe start date by which to filter incidents. Date format will be the same as in the incidents query page, for example: "3 days ago", ""2019-01-01T00:00:00 +0200").
toDateThe end date by which to filter incidents. Date format will be the same as in the incidents query page, for example: "3 days ago", ""2019-01-01T00:00:00 +0200").
limitThe maximum number of incidents to fetch.
includeContextDeprecated due to performance considerations. Rather than using this argument, it is recommended to retrieve the context of the incidents separately, preferably for a limited number of incidents.
timeFieldThe incident field to specify for the date range. Can be "created" or "modified". The default is "created". Due to performance considerations, you should only use "modified" if you have a large number of incidents.
NonEmptyFieldsA comma-separated list of non-empty value incident field names by which to filter incidents.
outputFormatThe output file format.
populateFieldsA comma-separated list of fields in the object to poplulate.
pageSizeIncidents query batch size

Outputs#


PathDescriptionType
GetIncidentsByQuery.FilenameThe output file name.String
GetIncidentsByQuery.FileFormatThe output file format.String