Skip to content

Incident Management v2: On-call roles and role-aware scheduling #59

Description

@Aidaho12

Parent epic: #45

Architectural direction

Incident Management v2 separates technical alert processing, operational incidents and on-call duty responsibilities:

Alert -> AlertGroup -> Incident

Team -> OnCallRole -> Schedule -> Rotation / Layers -> Members

On-call roles are separate from RBAC roles and from concrete roles assigned inside a specific Incident.

Architecture document: docs/architecture/incident-management-v2.md

Goal

Allow one team to have several simultaneous on-call users covering different operational functions, while keeping the existing schedule/rotation model and making Incident assignment, escalation and Event Orchestration role-aware.

Scope

  • Add team-owned OnCallRole.
  • Add built-in roles: primary, secondary, incident_responder, incident_commander, customer_communications, ticket_responder.
  • Allow team-owned custom roles such as Database SME, Network Responder or Security On-call.
  • Assign one On-call Role to each schedule.
  • Allow several schedules with different roles to be active for the same team simultaneously.
  • Allow several schedules to share one role when concurrent coverage is required.
  • Keep On-call Roles off the User model; one user may cover several roles by participating in several schedules.
  • Migrate every existing schedule to the built-in Primary On-call role without changing its rotation behavior.
  • Resolve current on-call users by team, role and timestamp.
  • Allow role resolution to return zero, one or several users.
  • Update the calendar to show role, schedule, user, shift interval and overrides.
  • Add calendar filters for team, On-call Role, schedule and user.
  • Allow escalation policies to target an On-call Role.
  • Allow Incident workflows to resolve current users by On-call Role and then create normal Incident assignments.
  • Do not keep a live Incident ownership link to the schedule: later rotation handoff must not silently replace users already assigned to the Incident.
  • Add API, OpenAPI, RBAC, audit, localization and migration coverage.

On-call Role versus Incident Role

On-call roles answer:

Who is currently expected to perform this function?

Incident roles answer:

Who is actually performing this function in this Incident?

Recommended mappings:

incident_commander       -> Incident commander
incident_responder       -> Incident responder
customer_communications  -> Incident communications role
custom OnCallRole        -> selectable Incident responder role

Resolving an On-call Role copies concrete users into the Incident. Schedule changes after assignment do not mutate the Incident automatically.

API expectations

GET    /api/on-call-roles
POST   /api/on-call-roles
GET    /api/on-call-roles/{id}
PATCH  /api/on-call-roles/{id}
DELETE /api/on-call-roles/{id}

GET    /api/on-call/current?team_id={team_id}&role={role_slug}

Existing schedule APIs expose on_call_role_id.

Do not introduce an additional OnCallTrack model unless a concrete requirement cannot be represented by multiple schedules sharing the same role.

Acceptance criteria

  • Existing schedules behave identically after migration and are assigned to Primary On-call.
  • A team can have several simultaneous current on-call users covering different roles.
  • One user can hold several On-call Roles simultaneously.
  • One role may resolve to several current users when several schedules cover it.
  • Current on-call resolution is deterministic for team + role + timestamp.
  • Calendar views support concurrent role-aware assignments.
  • Escalation policies can target an On-call Role without hard-coding a user.
  • Incident commander/responders can be populated from current On-call Roles.
  • Rotation handoff does not silently replace users already assigned to an active Incident.
  • On-call Roles do not grant RBAC permissions.
  • Custom roles are team-scoped and audited.
  • API, OpenAPI, migration, RBAC, localization and regression tests cover the behavior.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions