Skip to content

Commit

Permalink
feat(slack plugin): improve user experience when resolving cases via …
Browse files Browse the repository at this point in the history
…Slack (#5485)
  • Loading branch information
mvilanova authored Nov 15, 2024
1 parent 8e421a1 commit 1f148f1
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1892,16 +1892,6 @@ def handle_resolve_submission_event(
current_user=user,
)

# we run the case update flow
case_flows.case_update_flow(
case_id=updated_case.id,
previous_case=previous_case,
db_session=db_session,
reporter_email=updated_case.reporter.individual.email if updated_case.reporter else None,
assignee_email=updated_case.assignee.individual.email if updated_case.assignee else None,
organization_slug=context["subject"].organization_slug,
)

# we update the case notification with the resolution, resolution reason and status
blocks = create_case_message(case=updated_case, channel_id=context["subject"].channel_id)
client.chat_update(
Expand All @@ -1910,6 +1900,23 @@ def handle_resolve_submission_event(
channel=updated_case.conversation.channel_id,
)

try:
# we run the case update flow
case_flows.case_update_flow(
case_id=updated_case.id,
previous_case=previous_case,
db_session=db_session,
reporter_email=updated_case.reporter.individual.email
if updated_case.reporter
else None,
assignee_email=updated_case.assignee.individual.email
if updated_case.assignee
else None,
organization_slug=context["subject"].organization_slug,
)
except Exception as e:
log.error(f"Error running case update flow from Slack plugin: {e}")


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

0 comments on commit 1f148f1

Please sign in to comment.