Overview
Appends a new routing rule to the end of an event orchestration’s router rules. This is a convenience tool that retrieves the current configuration, adds your new rule, and updates the router.
This is a write tool that modifies your PagerDuty account. It requires the --enable-write-tools flag to be enabled.
Parameters
The ID of the event orchestration to append a rule to
new_rule
EventOrchestrationRuleCreateRequest
required
The new routing rule to append Show EventOrchestrationRuleCreateRequest properties
Description of this rule’s purpose Example: “Route database errors to database team”
Conditions to evaluate. The rule matches if any condition is true. Show EventOrchestrationRuleCondition properties
PCL condition expression Examples:
event.summary matches part 'database error'
event.severity equals 'critical'
event.source matches regex 'prod-db-.*'
actions
EventOrchestrationRuleActions
required
Actions to take when this rule matches The ID of the target service for routing Example: “PSI2I2O” Use event payload contents to dynamically determine the target service. Available to AIOps customers only.
Whether this rule should be disabled (not evaluated)
Response
Returns the updated EventOrchestrationRouter object with the new rule appended to the end of the rules list.
How It Works
This tool:
Retrieves the current router configuration
Appends your new rule to the end of the existing rules
Updates the router with the modified configuration
Returns the updated router
The new rule is evaluated after all existing rules, so it won’t affect existing routing logic.
Usage Examples
Add a routing rule
Add a rule to orchestration P1A2B3C that routes events with 'database' in the summary to service PABCDEF
Add a rule for critical events
Add a routing rule to orchestration P1A2B3C for critical severity events to route to the SRE on-call service
Add a rule with multiple conditions
Add a rule to orchestration P1A2B3C that routes events from production databases to service PXYZABC
PCL Expression Examples
PagerDuty Common Expression Language (PCL) is used for rule conditions:
String matching
event.summary matches part 'error'
event.summary matches part 'database'
event.summary matches regex 'Error: (\\d+)'
Equality checks
event.severity equals 'critical'
event.source equals 'monitoring-system'
event.custom_details.environment equals 'production'
Logical operators
event.severity equals 'critical' && event.source matches part 'prod'
Field existence
event.custom_details.region exists
Important Notes
Rules are evaluated in order. Your new rule will be evaluated last , after all existing rules. If an earlier rule matches the event, your new rule won’t be evaluated.
If the orchestration has no valid router configuration, this tool will raise an error.