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
20 changes: 20 additions & 0 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1514,6 +1514,7 @@ def handle_resolve_submission_event(
ack()
# we get the current or previous case
case = case_service.get(db_session=db_session, case_id=context["subject"].id)
previous_case = CaseRead.from_orm(case)

# we run the case status transition flow
case_flows.case_status_transition_flow_dispatcher(
Expand All @@ -1539,6 +1540,15 @@ def handle_resolve_submission_event(
current_user=user,
)

case_flows.case_update_flow(
case_id=case.id,
previous_case=previous_case,
db_session=db_session,
reporter_email=case.reporter.individual.email if case.reporter else None,
assignee_email=case.assignee.individual.email if case.assignee else None,
organization_slug=context["subject"].organization_slug,
)

# We update the case message with the new resolution and status
blocks = create_case_message(case=case, channel_id=context["subject"].channel_id)
client.chat_update(
Expand Down Expand Up @@ -1996,6 +2006,7 @@ def resolve_case(
context_from_user: str,
user: DispatchUser,
) -> None:
previous_case = CaseRead.from_orm(case)
case_flows.case_status_transition_flow_dispatcher(
case=case,
current_status=CaseStatus.closed,
Expand All @@ -2013,6 +2024,15 @@ def resolve_case(
)
case = case_service.update(db_session=db_session, case=case, case_in=case_in, current_user=user)

case_flows.case_update_flow(
case_id=case.id,
previous_case=previous_case,
db_session=db_session,
reporter_email=case.reporter.individual.email if case.reporter else None,
assignee_email=case.assignee.individual.email if case.assignee else None,
organization_slug=case.project.organization.slug,
)

blocks = create_case_message(case=case, channel_id=channel_id)
client.chat_update(
blocks=blocks, ts=case.conversation.thread_id, channel=case.conversation.channel_id
Expand Down