Skip to content

[datadog_on_call_team_routing_rules] Add reroute_to_team action - #4373

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
Bnjis/support-rerouting-action-oncall-routingrules
Oct 13, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
masterfrom
Bnjis/support-rerouting-action-oncall-routingrules

Conversation

@Bnjis

@Bnjis Bnjis commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds support for the reroute_to_team action in datadog_on_call_team_routing_rules. This action reroutes a matching page to another team's routing rules.

rule {
  query = "tags.service:checkout"
  action {
    reroute_to_team {
      destination_team_id = datadog_team.checkout.id
    }
  }
}

Why

The On-Call routing rules API now accepts a reroute_to_team action ({"type": "reroute_to_team", "destination_team_id": "<team uuid>"}), but it couldn't be managed from Terraform.

Changes

  • Bump datadog-api-client-go to a commit that includes RoutingRuleRerouteToTeamAction.
  • New action.reroute_to_team block with a destination_team_id attribute, validated as a UUID at plan time. The API returns the action on read, so plan, apply and import round-trip it.
  • Validate() applies the API's constraints at apply time, before the request is sent, so they fail early with a clear error:
    • destination_team_id is required.
    • At most one reroute_to_team action per rule.
    • A reroute can only be combined with send_slack_message or send_teams_message. Combining it with escalation_policy (attribute or action) or trigger_workflow_automation is rejected.
  • Update the example and the hand-maintained docs page.

Testing

  • New TestAccOnCallTeamRoutingRulesRerouteToTeam: creates three teams and reroutes two rules to them, swaps the destinations (update), then runs an ImportStateVerify step. A cassette was recorded.
  • New TestAccOnCallTeamRoutingRulesRerouteToTeamValidation: covers the validation errors. The cassette has no interactions.
  • TestAccOnCallTeamRoutingRules* pass in replay mode, including the existing tests with the bumped client.
  • make test, make fmtcheck, make vet and make check-docs pass.

Support the On-Call `reroute_to_team` routing rule action, which reroutes
a page to another team's routing rules. Bump datadog-api-client-go to
include RoutingRuleRerouteToTeamAction.

Validation mirrors the backend: destination_team_id is required, at most
one reroute per rule, and a reroute can only be combined with
send_slack_message or send_teams_message actions.
…ting-action-oncall-routingrules

# Conflicts:
#	go.mod
#	go.sum
@Bnjis
Bnjis marked this pull request as ready for review October 12, 2026 08:25
@Bnjis
Bnjis requested review from a team as code owners October 12, 2026 08:25
@Bnjis

Bnjis commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-13 08:20:17 UTC ℹ️ Start processing command /merge


2026-10-13 08:20:19 UTC ❌ MergeQueue

PR already in the queue with status in_progress

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 2a28c4f into master Oct 13, 2026
32 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the Bnjis/support-rerouting-action-oncall-routingrules branch October 13, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants