Use a slash command and a dialog to create a helpdesk ticket in a 3rd-party system. Once it has been created, send a message to the user with information about their ticket.
- Create an app at api.slack.com/apps
- Navigate to the OAuth & Permissions page and add the following scopes:
commands
users:read
users:read.email
chat:write:bot
- Click 'Save Changes' and install the app
- Get the code
- Either clone this repo and run
npm install
- Or visit https://glitch.com/edit/#!/remix/slack-slash-command-and-dialogs-blueprint
- Either 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)
- If you're running the app locally:
- 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:
/helpdesk
- Request URL: Your ngrok or Glitch URL + /commands
- Short description:
Create a helpdesk ticket
- 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 or Glitch URL + /interactive-component