Skip to content

Commit

Permalink
Update src/dispatch/incident/flows.py
Browse files Browse the repository at this point in the history
Co-authored-by: Will Sheldon <[email protected]>
Signed-off-by: David Whittaker <[email protected]>
  • Loading branch information
whitdog47 and wssheldon authored Dec 13, 2024
1 parent d2d2be0 commit b1a9c4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dispatch/incident/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,18 @@ def incident_closed_status_flow(incident: Incident, db_session=None):
document=document, db_session=db_session
)

# if there are any associated cases, we close them as well
for case in incident.cases:
for case in incident.cases:
try:
case.resolution = (
f"Closed as part of incident {incident.name}. See incident for more details."
)
case.resolution_reason = CaseResolutionReason.escalated
case.status = CaseStatus.closed
case_flows.case_closed_status_flow(case=case, db_session=db_session)
except Exception as e:
log.exception(
f"Failed to close case {case.name} while closing incident {incident.name}. Error: {str(e)}"
)

# we send a direct message to the incident commander asking to review
# the incident's information and to tag the incident if appropriate
Expand Down

0 comments on commit b1a9c4a

Please sign in to comment.