Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,15 @@ def common_escalate_flow(
db_session.add(incident)
db_session.commit()

# we run the incident create flow in a background task
incident = incident_flows.incident_create_flow(
incident_id=incident.id,
organization_slug=organization_slug,
db_session=db_session,
case_id=case.id,
)

# we link the case to the incident
case.incidents.append(incident)
db_session.add(case)
db_session.commit()
Expand All @@ -755,14 +764,6 @@ def common_escalate_flow(
case_id=case.id,
)

# we run the incident create flow in a background task
incident = incident_flows.incident_create_flow(
incident_id=incident.id,
organization_slug=organization_slug,
db_session=db_session,
case_id=case.id,
)

# we add the case participants to the incident
for participant in case.participants:
# check to see if already a participant in the incident
Expand Down