Use a slash command and a dialog to create a bug report and have it posted to the correct triage channel based on the product area.
- Create an app at api.slack.com/apps
- Navigate to the OAuth & Permissions page and add the following scopes:
commands
chat:write:bot
- Click 'Save Changes' and install the app
- Get the code
- Clone this repo and run
npm install
- Clone this repo and run
- Set the following environment variables to
.env
(see.env.sample
):SLACK_ACCESS_TOKEN
: Your app'sxoxp-
token (available on the Install App page)PORT
: The port that you want to run the web server onSLACK_VERIFICATION_TOKEN
: Your app's Verification Token (available on the Basic Information page)
- Run it
- Start the app (
npm start
) - In another window, start ngrok on the same port as your webserver (
ngrok http $PORT
)
- Start the app (
- Go back to the app settings and click on Slash Commands.
- Click the 'Create New Command' button and fill in the following:
- Command:
/bug-it
- Request URL: Your ngrok URL + /slack/events/commands
- Short description:
Create a bug report
- Usage hint:
[the problem you're having]
- Command:
- Save and reinstall the app
- Go back to the app settings and click on Interactive Components.
- Set the Request URL to your ngrok URL + /slack/events/components