Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 1f148f1

Browse files
authored
feat(slack plugin): improve user experience when resolving cases via Slack (#5485)
1 parent 8e421a1 commit 1f148f1

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/dispatch/plugins/dispatch_slack/case/interactive.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,16 +1892,6 @@ def handle_resolve_submission_event(
18921892
current_user=user,
18931893
)
18941894

1895-
# we run the case update flow
1896-
case_flows.case_update_flow(
1897-
case_id=updated_case.id,
1898-
previous_case=previous_case,
1899-
db_session=db_session,
1900-
reporter_email=updated_case.reporter.individual.email if updated_case.reporter else None,
1901-
assignee_email=updated_case.assignee.individual.email if updated_case.assignee else None,
1902-
organization_slug=context["subject"].organization_slug,
1903-
)
1904-
19051895
# we update the case notification with the resolution, resolution reason and status
19061896
blocks = create_case_message(case=updated_case, channel_id=context["subject"].channel_id)
19071897
client.chat_update(
@@ -1910,6 +1900,23 @@ def handle_resolve_submission_event(
19101900
channel=updated_case.conversation.channel_id,
19111901
)
19121902

1903+
try:
1904+
# we run the case update flow
1905+
case_flows.case_update_flow(
1906+
case_id=updated_case.id,
1907+
previous_case=previous_case,
1908+
db_session=db_session,
1909+
reporter_email=updated_case.reporter.individual.email
1910+
if updated_case.reporter
1911+
else None,
1912+
assignee_email=updated_case.assignee.individual.email
1913+
if updated_case.assignee
1914+
else None,
1915+
organization_slug=context["subject"].organization_slug,
1916+
)
1917+
except Exception as e:
1918+
log.error(f"Error running case update flow from Slack plugin: {e}")
1919+
19131920

19141921
@app.shortcut(CaseShortcutCallbacks.report, middleware=[db_middleware, shortcut_context_middleware])
19151922
def report_issue(

0 commit comments

Comments
 (0)