> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/ai-sre/3.0/ai-sre-for-administrators/set-up-runbook-management/workflows/common-use-cases.md).

# Common Use Cases

Common use cases for incident fields in runbook actions.

### Common use cases <a href="#common-use-cases" id="common-use-cases"></a>

#### Dynamic notification routing <a href="#dynamic-notification-routing" id="dynamic-notification-routing"></a>

**Scenario:** Route notifications to service-specific channels

**Slack action configuration:**

* **Channel** (form field): `#{{ActivityPretty.impacted_services}}-incidents`

Note: `ActivityPretty.impacted_services` joins every impacted service with commas, so an incident with more than one service produces a combined value here. If the destination takes a single value, such as a channel name, use `{{Activity.id}}` instead.

* **Message:**

  ```
  🚨 New incident in {{ActivityPretty.impacted_services}}
  Severity: {{Activity.severity.label}}
  ```

If `Activity.impacted_services` includes `payment-service`, message goes to `#payment-service-incidents`

#### Service-specific runbooks <a href="#service-specific-runbooks" id="service-specific-runbooks"></a>

**Scenario:** Trigger different remediation based on affected service

**Implementation:** Use trigger conditions

* Trigger 1: `Activity.impacted_services.exists(s, s.name == "payment-service")`, then run the "Restart Payment Pods" runbook
* Trigger 2: `Activity.impacted_services.exists(s, s.name == "database")`, then run the "Database Health Check" runbook

#### Custom field integration <a href="#custom-field-integration" id="custom-field-integration"></a>

{% hint style="info" %}
The examples in this section use `affected_users`. These are custom fields, not built-in fields. They resolve only if your incident or alert template has a field with that exact field ID, so replace them with your own field IDs.
{% endhint %}

**Scenario:** Your incident type has a custom field `affected_users` (Number type)

**Jira ticket description:**

```
Impact: {{Activity.affected_users}} users affected
Service: {{ActivityPretty.impacted_services}}
Severity: {{Activity.severity.label}}
```

#### Environment-specific actions <a href="#environment-specific-actions" id="environment-specific-actions"></a>

**Scenario:** Different escalation for production vs. staging

**Trigger conditions:**

* Trigger 1: `Activity.tags.exists(t, t == "production") AND Activity.severity.id in ["0", "1"]`, then page VP Engineering
* Trigger 2: `Activity.tags.exists(t, t == "staging" || t == "development")`, then post to `#dev-incidents`

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Use Mustache templates in runbook actions](https://developer.harness.io/ai-sre/3.0/ai-sre-for-administrators/set-up-runbook-management/workflows/use-mustache-runbook-actions.md) to learn how to implement these patterns.
* Go to [Use CEL in runbook actions](https://developer.harness.io/ai-sre/3.0/ai-sre-for-administrators/set-up-runbook-management/workflows/use-cel-runbook-actions.md) to add advanced dynamic content.
* Go to [Best practices](https://developer.harness.io/ai-sre/3.0/ai-sre-for-administrators/set-up-runbook-management/workflows/best-practices.md) to review usage guidelines.

{% @harness-feedback/feedback %}
