Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(slack): add users to threaded case on mention #5530

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented Nov 23, 2024

This feature enhancement introduces the ability to add users to a threaded case in Slack when they are mentioned. This functionality aims to streamline collaboration by ensuring that all relevant participants are included in the case discussions.

Key Changes:

  1. New Enum Values:

    • Added add_user and do_nothing actions to CaseNotificationActions in enums.py.
  2. User Mention Handling:

    • Implemented handle_user_mention function in case/interactive.py to detect user mentions in messages.
    • Extracts mentioned users and checks if they are part of the case.
    • Sends a private message to the user who mentioned others, offering to add the mentioned users to the case.
  3. User Addition Workflow:

    • Added add_users_to_case function to handle the addition of users to a case when the "Add Them" button is clicked.
    • Utilizes AddUserMetadata to manage user data and case context.
  4. Middleware Enhancements:

    • Introduced add_user_middleware in middleware.py to process user addition requests.
    • Ensures the correct context is passed for user addition actions.
  5. UI Components:

    • Created UI blocks for user notification and action buttons in Slack messages.
    • Utilized DefaultBlockIds for consistent block identification.
  6. Model Updates:

    • Added AddUserMetadata class in models.py to encapsulate user and case metadata.
image

@whitdog47 whitdog47 added the enhancement New feature or request label Nov 23, 2024
@whitdog47 whitdog47 self-assigned this Nov 23, 2024
# Delete the ephemeral message
respond(delete_original=True)
except SlackApiError as e:
print(f"Error deleting ephemeral message: {e.response['error']}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(f"Error deleting ephemeral message: {e.response['error']}")
log.error(f"Error deleting ephemeral message: {e.response['error']}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants