django-DefectDojo
django-DefectDojo copied to clipboard
Improve Slack integration to allow notifying private, public, and group channels (fixes #8569)
This change enables users to set private, public, or group channels as the target for Slack notifications.
It achieves this by removing the slack_user_id
intermediary field, which was filled with a response after querying the Slack API with the user's email, and which limited the notification targets to users' private Slack channels. Before removal, the value is copied into slack_username
field, overwriting the email address, which is no longer needed (and no longer works).
Detailed explanations are in #8569.
Test results
- Unit tests pass.
- SLA breach notifications are delivered successfully when
slack_username
is set to a channel names, with and without a "#" prefix. - Also success when a channel ID is used.
Documentation
No changes in the documentation are needed. However, I noticed that the Slack administration page looks now differently, so I updated the relevant screen shot in the "Notifications" section.
Checklist
This checklist is for your information.
- [x] Unit tests pass.
- [x] Your code is flake8 compliant.
- [x] Model changes must include the necessary migrations in the dojo/db_migrations folder.