Processing rules
Writing rules
Reference for processing rule fields, scope, conditions and actions.
This is the format of a processing rule, as the endpoints and accept it. Rules are not applied to incoming events yet; see Processing rules for the current status.
Rule fields
{
"name": "Human-readable name",
"description": "What this rule does and why",
"enabled": true,
"priority": 100,
"scope": {},
"conditions": [],
"actions": [],
"stopProcessing": false
}| Field | Meaning |
|---|---|
| Lower numbers run first | |
| Which events the rule applies to. Empty means all | |
| All must match (AND) | |
| Run in order when the conditions match | |
| When true, no later rule runs after this one matches |
Scope
Every scope field is optional.
| Field | Example | Notes |
|---|---|---|
| , , , , | ||
| matches any characters. The whole name must match | ||
| Exact event type names |
Conditions
Fields use dot notation for nested values, for example .
| Type | Example | Matches when |
|---|---|---|
| The value is exactly equal (string, number or boolean) | ||
| The string value contains a match for the regular expression. Use and to match the whole value | ||
| The value is one of the list | ||
| The field is present and not null | ||
| The value is a number greater than | ||
| The value is a number less than |
Actions
| Type | Example | Effect |
|---|---|---|
| Sets a field on the event | ||
| Copies a field, translating values found in | ||
| Marks the event's notification as suppressed | ||
| Records an escalation to the named channel | ||
| Adds a tag | ||
| , , or |
Testing rules
runs all of your organization's rules against a sample event:
{
"provider": "github",
"repository": "my-org/api",
"eventType": "workflow_run",
"data": { "workflowName": "nightly-build", "status": "failure", "branch": "main" }
}The response lists the rules that matched, whether the notification would be suppressed, any escalations, and the event data after all actions.
Example: tag infrastructure workflows
{
"name": "Tag infrastructure workflows",
"priority": 300,
"enabled": true,
"scope": {},
"conditions": [
{ "type": "field_matches", "field": "workflowName", "pattern": "terraform|cdk|infra" }
],
"actions": [
{ "type": "add_tag", "tag": "infrastructure" }
],
"stopProcessing": false
}