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

org: Add slack bot integration to send timelog updates. #3021

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

apoorvapendse
Copy link
Contributor

@apoorvapendse apoorvapendse commented Nov 30, 2024

This PR fixes #2973.

Implmented features.

  1. Slack Oauth integration to generate and store slack bot token for organzation.
  2. UI to manage future integrations with other services.
  3. Manage command to send updates, which can be run as a cron job every hour.
  4. The messages are only sent when the UTC hour difference between current time and organization set time is <= 1hour.
  5. Organization can configure the channel they prefer to receive updates every 24 hours.
  6. Summary will contain info about all the timelogs that were dedicated for the organization is the past 24 hours.

https://github.com/user-attachments/assets/1387679c-e442-4222-89e3-5b98d46d0a70
image

company/views.py Fixed Show fixed Hide fixed
company/views.py Fixed Show fixed Hide fixed
redirect_uri = "http://localhost:8000/oauth/slack/callback"
state = urlencode({"company_id": id})
auth_url = f"https://slack.com/oauth/v2/authorize?client_id={client_id}&scope={scopes}&state={state}&redirect_uri={redirect_uri}"
return redirect(auth_url)

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant