Go to Slack

Capturing data with a Slash Command & Dialog

Use cases:
  • Initiate actions in external systems from Slack
  • Kick-off Slack-based workflows
  • Capture bug reports
  • Survey users
Works with:
  • Slash commands
  • Dialogs
Code samples:

Allow people in Slack to create a helpdesk ticket in a 3rd party system using a Slash Command and a Dialog.

This app blueprint assumes you're able to create tickets in your 3rd party system programatically.

How it works

1. Receive Slash Command events from Slack

When a user executes the Slash Command associated with the app (e.g. /helpdesk [title of the issue], Slack will send a POST request to the Slash Command request URL provided in the app settings. This request will include the text sent along with the Slash Command.

2. Open a Dialog

In order to collect more information, the app will open a Dialog in Slack where the user can fill in a detailed description of the problem and assign a priority to their ticket. When the user submits the Dialog, Slack will send a POST request to the Interactive Component request URL provided in the app settings. This request will include all the information from the Dialog, a callback_id, as well as details about the user who took the action.

3. Create helpdesk ticket

The app will leverage your ticketing system's API to create a ticket on behalf of the user who executed the Slash Command. You can either map users based on email address or use the account binding blueprint to ensure that all existing authorizations are respected. Once the ticket has been created, a status update can be sent back to Slack using the chat.postMessage method and the chat:write:bot scope.

Diagram

A flow diagram detailing a slash command that triggers a dialog

Related documentation