Skip to main content

core.require

Evaluate a conditional expression and returns the boolean result.

Inputs

conditions
boolean | array[boolean]
required
Conditional expression(s) to evaluate. All must be true for the result to be true.
raise_error
boolean
If True, the function will raise an error if the condition is false. If False, the function will return False instead.Default: true.
require_all
boolean
If True, all conditions must be true for the result to be true. If False, only one condition must be true.Default: true.

Examples

Stop when prerequisites are not met
- ref: require_inputs
  action: core.require
  args:
    conditions:
      - ${{ TRIGGER.case_id != None }}
      - ${{ TRIGGER.severity in ["high", "critical"] }}
    require_all: true
    raise_error: true