diff --git a/src/dispatch/case/flows.py b/src/dispatch/case/flows.py index aece35c4e642..c75f768e0ada 100644 --- a/src/dispatch/case/flows.py +++ b/src/dispatch/case/flows.py @@ -443,8 +443,9 @@ def case_escalated_status_flow( case: Case, organization_slug: OrganizationSlug, db_session: Session, - incident_priority: IncidentType | None, - incident_type: IncidentPriority | None, + title: str | None, + incident_priority: IncidentPriority | None, + incident_type: IncidentType | None, incident_description: str | None, ): """Runs the case escalated transition flow.""" @@ -457,6 +458,7 @@ def case_escalated_status_flow( case=case, organization_slug=organization_slug, db_session=db_session, + title=title, incident_priority=incident_priority, incident_type=incident_type, incident_description=incident_description, @@ -792,6 +794,7 @@ def case_to_incident_escalate_flow( case: Case, organization_slug: OrganizationSlug, db_session: Session, + title: str | None, incident_priority: IncidentPriority | None, incident_type: IncidentType, incident_description: str | None, @@ -808,16 +811,18 @@ def case_to_incident_escalate_flow( ) ) + title = title if title else case.title + description = ( f"{incident_description if incident_description else case.description}\n\n" f"This incident was the result of escalating case {case.name} " f"in the {case.project.name} project. Check out the case in the Dispatch Web UI for additional context." ) - incident_priority = case.case_priority if not incident_priority else incident_priority + incident_priority = incident_priority if incident_priority else case.case_priority incident_in = IncidentCreate( - title=case.title, + title=title, description=description, status=IncidentStatus.active, incident_type=incident_type, diff --git a/src/dispatch/plugins/dispatch_slack/case/interactive.py b/src/dispatch/plugins/dispatch_slack/case/interactive.py index be6a0c5e55ea..dcc3c8c218ce 100644 --- a/src/dispatch/plugins/dispatch_slack/case/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/case/interactive.py @@ -1268,11 +1268,12 @@ def handle_escalation_submission_event( name=form_data[DefaultBlockIds.incident_priority_select]["name"], ) incident_description = form_data.get(DefaultBlockIds.description_input, case.description) - + title = form_data.get(DefaultBlockIds.title_input, case.title) case_flows.case_escalated_status_flow( case=case, organization_slug=context["subject"].organization_slug, db_session=db_session, + title=title, incident_priority=incident_priority, incident_type=incident_type, incident_description=incident_description,