Skip to main content

Create Runbook Triggers

Last updated on

Creating Triggers

Step 1: Access Trigger Configuration

  1. Open your existing runbook in the Harness AI SRE platform
  2. Click the Triggers tab in your runbook editor
  3. This opens the trigger configuration interface

Step 2: Create New Trigger

  1. Click + New Trigger to begin the trigger setup process
  2. This opens the trigger creation wizard

Step 3: Choose Trigger Template

  1. Select the Incident Type template from the available options
  2. Choose the specific Incident Type from the dropdown menu
  3. The selected incident type determines which fields and values will be available for condition configuration
  4. This selection affects what data you can use when setting up trigger conditions

Step 4: Define Trigger Conditions

  1. Choose Condition Type: Select either ALL or ANY for your condition logic:
    • ALL: All conditions must be met for the trigger to activate
    • ANY: Any one of the conditions can activate the trigger
  2. Set Frequency: Choose when the trigger should evaluate:
    • Activity Created: Trigger when new incidents are created
    • Activity Updated: Trigger when incidents are updated
    • Key Event Created: Trigger when key events are added to incidents
  3. Add Conditions: Click to add specific field-based conditions for more precise triggering

Step 5: Configuring Additional Conditions

To add more specific conditions beyond the basic frequency setting:

  1. Select Field: Choose the incident field you want to monitor from the dropdown
    • Fields available depend on the incident type selected in Step 3
    • Options include standard incident fields and custom fields for that incident type
  2. Choose Comparison Type: Select what aspect of the field to monitor:
    • Old Values: Compare against the previous value of the field
    • New Values: Compare against the current/new value of the field
    • Changed Field: Trigger when the field value changes (regardless of specific values)
  3. Select Comparator: Choose how to compare the field value:
    • Equals: Exact match with the specified value
    • Contains: Field contains the specified text
    • Greater Than/Less Than: Numeric comparisons
    • Other operators: Based on field type and requirements
  4. Enter Value: Provide the value to compare against
  5. Repeat: Add multiple conditions as needed using the ALL/ANY logic set in Step 4

Step 6: Save and Activate

  1. Review Configuration: Verify all trigger settings are correct
  2. Save Trigger: Click Save to create the trigger
  3. Test Trigger: Test the trigger by creating dummy conditions that match your configuration
  4. Monitor Execution: Track trigger performance and effectiveness once activated

Severity Field Values

Harness AI SRE uses numeric string values for severity levels. When configuring trigger conditions, use these exact string values:

ValueLabelSeverity Level
"0"SEV0:CriticalHighest severity
"1"SEV1:MajorHigh severity
"2"SEV2:ModerateModerate severity
"3"SEV3:MinorLow severity
"4"SEV4:CosmeticLowest severity

Example trigger condition:

To trigger on critical incidents, use:

severity = "0"

To trigger on major incidents, use:

severity = "1"

Supported Comparison Operators

Because severity values are strings, only certain comparison operators work correctly.

Supported operators for severity (string field):

  • = (Equals): Match exact severity level
  • != (Does not equal): Match all except specified severity level
  • CONTAINS: Match if severity string contains specified text
  • DOES_NOT_CONTAIN: Match if severity string does not contain specified text

Unsupported operators for severity (string field):

  • > (Greater than): Does not work with string values
  • < (Less than): Does not work with string values
  • >= (Greater than or equal to): Does not work with string values
  • <= (Less than or equal to): Does not work with string values

You cannot use severity > "2" to match SEV0 and SEV1. This comparison will not work because severity is stored as a string, not a number.

Match Multiple Severity Levels

To trigger on multiple severity levels (for example, SEV0 OR SEV1), use one of these approaches:

Option 1: Multiple conditions with OR logic

Create separate conditions and set the condition match type to Match Any (OR):

  1. Add first condition: severity = "0"
  2. Add second condition: severity = "1"
  3. Set match type to Match Any (OR)

The trigger will activate when the incident severity is either "0" or "1".

Option 2: Multiple triggers

Create separate triggers for each severity level within the same runbook assignment. Each trigger handles one severity level independently.

Alternative Severity Naming Conventions

The system accepts alternative severity names from integrations like FireHydrant and PagerDuty. These values are automatically mapped to numeric severity strings:

Alternative NamesMapped Value
SEV0, SECURITY0, CUSTOMER-P0"0"
SEV1, INTERNAL-PROD, SECURITY1, CUSTOMER-P1"1"
SEV2, DEPLOYMENT, SECURITY2"2"
SEV3, INTERNAL-NONPROD, MAINTENANCE"3"
Any other value"4"

When incidents are created from external integrations, the severity value is normalized to the numeric string format automatically.


Next steps

Now that you have created a trigger, you can configure advanced logic and test your automation.

info

Need Help? Contact our support team by email at support@harness.io or visit the Harness Documentation for additional resources and troubleshooting guides.