How to Connect the Enji.ai Bot in Slack
This guide covers registering and setting up the Enji.ai bot in a Slack environment.
These steps require administrator rights for the Slack space, specifically Space Admin or Space Owner.
Slack APP bot registration
1. Go to the page https://api.slack.com/apps.
2. Click on Create an App.
3. Choose the option "From an app manifest."
4. Select the workspace the Enji Slack Bot should work with.
5. In the YAML tab, enter the manifest (see below). Replace URLs as indicated in bold:
<slack-bot-url...>
– Insert the URL where the bot is deployed, provided by the Enji.ai DevOps team.<frontend-domain.com...>
– – Insert the URL to the site through which users will access Enji, e.g., yourcompany.enji.ai.
display_information: name: Enji.ai description: Teamlead that never sleeps background_color: "#303036" features: bot_user: display_name: Enji.ai always_online: true slash_commands: - command: /report url: https://slack-bot-url-where.deployed.com/slack/commands description: Request report on the team’s activity should_escape: false oauth_config: redirect_urls: - https://frontend-domain.com/api/v1/project/set_workspace_token - https://slack-bot-url-where.deployed.com/slack/set_user_token - https://slack-bot-url-where.deployed.com/slack/check_reaction_and_notify scopes: bot: - app_mentions:read - channels:history - channels:read - chat:write - chat:write.customize - chat:write.public - commands - groups:history - groups:read - im:history - im:read - im:write - reactions:read - reactions:write - users.profile:read - users:read - users:read.email - files:read - files:write - remote_files:write - remote_files:read - remote_files:share settings: event_subscriptions: request_url: https://slack-bot-url-where.deployed.com/slack/event bot_events: - app_home_opened - app_mention - app_uninstalled - message.channels - message.groups - message.im - reaction_added - reaction_removed interactivity: is_enabled: true request_url: https://slack-bot-url-where.deployed.com/slack/action org_deploy_enabled: false socket_mode_enabled: false token_rotation_enabled: false
6. APP Credentials.
Provide the following secrets to the DevOps team:
- App ID
- Client ID
- Client Secret
- Signing Secret
7. In Display Information specify the avatar: https://images.prismic.io/enji-landing/ZmK-DJm069VX1ic9_book-a-demo-OG.png
8. In the Features -> OAuth & Permissions menu -> OAuth Tokens for Your Workspace, click on Install to Workspace.
9. Bot User OAuth Token – Provide the token to the DevOps team.
10. Make the application (bot) public:
Open Enji.ai APP -> Settings -> Manage Distribution
11. Scroll down the page, tick off, and click Activate Public Distribution.
12. Go to Enji.ai APP -> Features -> App Home -> Show Tabs. Deactivate "Allow users to send Slash commands…" The setting will be automatically saved.
13. This step is handled by the deploying DevOps.
Backend and slack-bot environment variables need to be filled out:
Backend:
SLACK_BOT_CLIENT_ID=XXXXXXXXXXXX.XXXXXXXXXXXX SLACK_BOT_CLIENT_SECRET=3ced*****************91f3c # Slack bot base url SLACK_BASE_URL=http://slack-bot:8000 COLLECTOR_URL=<enji.company.name> COLLECTOR_INNER_HOST=collector:5000
Slack-bot:
# Slack App Credentials SELF_URL=https://<slack-domain.enji.company.name> SLACK_URL=https://slack.com/api SLACK_OAUTH=oauth.access SLACK_SIGNING_SECRET=bba********************ef9 SLACK_COLLECTOR_BOT_ID=A0******RM SLACK_COLLECTOR_BOT_TOKEN=xoxb-28155375..... SLACK_COLLECTOR_BOT_CLIENT_ID=XXXXXXXXXXXX.XXXXXXXXXXXX SLACK_COLLECTOR_BOT_CLIENT_SECRET=3ced*****************91f3c SLACK_COLLECTOR_BOT_SCOPE=channels:history,channels:read,chat:write:bot,commands,groups:history,groups:read,im:history,im:read,mpim:history,mpim:read,reactions:write,users.profile:read,chat:write:user # Enji backend API's SLACK_COLLECTOR_GET_TRIGGERS_URL=http://collector:5000/api/v1/triggers/ SLACK_COLLECTOR_GET_SLACK_USER=http://collector:5000/api/v1/get_slack_user/ SLACK_COLLECTOR_GET_ACTIVITY=http://collector:5000/api/v1/me/activity/collector SLACK_COLLECTOR_SEND_STANDUP_URL=http://collector:5000/api/v1/register_stand-up/ SLACK_COLLECTOR_UPDATE_SLACK_USER=http://collector:5000/api/v1/update_slack_user/ SLACK_COLLECTOR_UPDATE_STATUS=http://collector:5000/api/v1/update_employee_status/ SLACK_COLLECTOR_GET_EMPLOYEE_STATUS=http://collector:5000/api/v1/get_employee_status/ SLACK_COLLECTOR_GET_CREDENTIALS_URL=http://collector:5000/api/v1/get_slack_credentials/ SLACK_COLLECTOR_EVENT_REGISTER_URL=http://collector:5000/api/v1/triggering/register_event/ SLACK_COLLECTOR_TRIGGER_FORCE_REPORT_URL=http://collector:5000/api/v1/get_projects_for_stand-up/ SLACK_COLLECTOR_GET_MOTIVATIONAL_MESSAGE=http://collector:5000/api/v1/get_motivational_message/ SLACK_COLLECTOR_GET_PROJECTS_FOR_STANDUP_URL=http://collector:5000/api/v1/get_projects_for_stand-up/ SLACK_COLLECTOR_DELETE_STANDUP_MESSAGE_URL=http://collector:5000/api/v1/delete_stand-up/ SLACK_COLLECTOR_UPLOAD_URL=http://collector:5000/api/v1/upload/ SLACK_COLLECTOR_UPDATE_BOT_CONNECTION_STATUS_TO_FALSE=http://collector:5000/api/v1/update_bot_connection_status_to_false/ # Redis conection envs REDIS_HOST=redis-0 REDIS_PORT=6379
Frontend:
VUE_APP_ADD_TO_SLACK_URL=https://slack.com/oauth/authorize?client_id=XXXXXXXXXXXXX.XXXXXXXXXXXXX\&granular_bot_scope=1\&scope=app_mentions:read,channels:history,channels:read,chat:write,chat:write.customize,chat:write.public,files:read,files:write,groups:history,groups:read,im:history,im:read,im:write,reactions:read,reactions:write,remote_files:read,remote_files:share,remote_files:write,users.profile:read,users:read,users:read.email,commands\&redirect_uri=https://<enji.company.name>/api/v1/project/set_workspace_token
Configuration
1. Open the organization's Enji site and navigate to the settings of the project whose employees will submit stand-ups in Slack (Settings -> Project List -> Project ID).
2. In the project settings, click on Connect Slack.
3. A Slack page will open where the user will need to select the Slack Workspace for which they previously created the Slack APP Bot and click Allow.
4. Return to the project's settings page in Enji (Settings -> Project List -> Project ID). Click on the Chat Workspace input and select the Slack Workspace for which the Slack APP Bot was just created. Click Save.
5. Open the Slack Workspace of the project. Click on Add APPs and add Enji.ai.
6. Create a Slack Channel where employees will submit stand-ups, add participants to it, and then tag the Enji.ai bot in this channel by sending a message like @Enji.ai. This will establish a connection between the Slack Channel and Enji.
7. Enji will need some time (15 minutes to 1 hour) to gather information about all available Slack Channels in the Slack Workspace. After this, return to the project settings (Settings -> Project List -> Project ID), click on the Team Channel input, and select the Slack Channel where the employees of this project will submit stand-ups.
Now everything is ready. Employees can start submitting stand-ups!