For the complete documentation index, see llms.txt. This page is also available as Markdown.

Case field-triggered scripts

Configure Cortex XSIAM field-change-triggered scripts to automate case updates, enrichment, and notifications.

RBAC permissions

Configuring case field-triggered scripts requires the following RBAC permissions:

  • Under Configurations → Object Setup, View/Edit permission for Fields and Types.

  • Under Investigation & Response → Automations, Scripts must be set to Enabled. Without this permission, the Attributes tab isn't available. In addition, if you want to create your own scripts, you must have the Create Scripts sub-permission selected.

Configure Cortex XSIAM case fields to run scripts when field values change. Use case field-triggered scripts to update other case fields, notify responders, or start follow-up actions when a case changes. For example, a script can run when a case's severity or status changes.

Create case automation scripts in Python, PowerShell, or JavaScript on the Scripts page. To use a script as a case field trigger, add the field-change-triggered-case tag. Then select the script from the Attributes tab when you create or edit a case field. Scripts without this tag can't be selected.

When a case field that has a script changes:

  • Cortex XSIAM saves the field change first, and then runs the script. The update doesn't wait for the script to finish. If the script fails, the field change is still saved.

  • If a single update changes several fields that have scripts, the script assigned to each changed field runs.

  • During a bulk update, a field-triggered script runs in every case where its assigned field changes.

  • A script can update the case by using the setCase command.

  • Changes that a script makes with setCase don't trigger other field-triggered scripts. If a script triggered by field A uses setCase to change field B, Cortex XSIAM doesn't run the script assigned to field B.

Case and issue field-triggered scripts use different tags, arguments, and update behavior. Scripts tagged only field-change-triggered, are issue field triggers and don't appear in the list for case fields.

Case field-triggered script arguments

Case field-triggered scripts receive the following arguments (args):

Argument
Description

name

The CLI name of the field that changed.

old

The previous value of the field.

new

The new value of the field.

case

The case after the change. Contains the values of all system and custom case fields, keyed by field CLI name, including case_id.

  • For fields that hold a list, such as multi-select fields, new contains the complete new value of the field, not only the added items.

  • The case argument can arrive as an object or as a JSON string. Parse it before you use it, as shown in the example script.

Assign a triggered script to a case field

After you create a case field-triggered script in Python, PowerShell, or JavaScript, associate it with a case field.

  1. Go to Settings → Configurations → Object Setup → Cases → Fields.

  2. Right-click the case field and select Edit, or click New Field to create a field.

  3. In the Attributes tab, under Script to run when field changes, select the case field-triggered script.

    Case field-triggered scripts must have the field-change-triggered-case tag to appear in the list.

  4. Save the field.

To see which case fields have an assigned script, add the Change Script Name column to the table on the Fields tab. You can filter the table by this column.

Last updated

Was this helpful?