Setting up the Slack app
Point your Slack app at QuantumOps: events, interactivity, the /qubit command, the older slash commands, bot permissions and direct messages.
Written By Chris Scaminaci
Last updated About 3 hours ago
Qubit and the older slash commands reach QuantumOps through your Slack app. This page lists what a Slack workspace admin changes in that app: Event Subscriptions, Interactivity, the /qubit command, the older slash commands, the bot's permissions and the App Home. Each step points at an address that QuantumOps shows you.
Before you start:
- You need to be able to edit your Slack app. The steps assume you already have a Slack app for QuantumOps, the one that gave you the app ID, bot token and signing secret.
- In QuantumOps you need the Administrator role to see the addresses on the Channel Assistant page, and the Administrator or Q-Director Configuration role to use the Messaging tab.
- The Slack and Teams credentials, and the platform choice, are described in Q-Director: Slack, Teams and agent mapping.
Store the credentials first
Slack checks the events address the moment you save it, and QuantumOps answers only requests that carry a valid signature. So store the credentials before you change anything in Slack.
- Open Configuration β Q-Director Config β Messaging.
- Choose Slack under Select Communication Platform.
- Enter Slack App ID, Slack Bot Token, Slack Signing Secret and Slack Webhook URL. The bot token is the bot token that starts with
xoxb-, not a user token. - Select Save All Configuration.
Find your addresses
- Open Configuration β Channel Assistant.
- On the Slack card, scroll to Setup reference.
- Note the addresses for Events, Interactivity and Slash command /qubit, and the list of Scopes.
Use the addresses exactly as shown.
Turn on Event Subscriptions
- In your Slack app, open Event Subscriptions and turn Enable Events on.
- Paste the Events address into Request URL. Slack tests it straight away.
- Under Subscribe to bot events, add
app_mentionandmessage.im.app_mentionlets Qubit hear when someone mentions it in a channel;message.imlets it receive direct messages. - Leave Subscribe to events on behalf of users empty. If
message.imis listed there, Slack also sends the app the installer's private messages with other people. QuantumOps drops any direct message Qubit is not part of, but Slack should never send them at all. - Save the changes.
Turn on Interactivity and add the Ask Qubit shortcut
- Open Interactivity & Shortcuts and turn Interactivity on.
- Paste the Interactivity address into Request URL. Slack uses it for the buttons on Qubit's messages (approvals, Share in conversation, the model picker and Q-Notice buttons) and for the shortcut.
- Under Shortcuts, select Create New Shortcut and choose On messages.
- Enter the name
Ask Qubitand a short description, such as "Ask Qubit about this message. Only you see the answer until you share it." - Enter
qubit_ask_messageas the Callback ID. It must match exactly, or the shortcut does nothing. - Save the shortcut and the page.
People can now open the menu on any message and choose Ask Qubit. See Commands and private answers.
Add the /qubit command
- Open Slash Commands and select Create New Command.
- Enter the command
/qubit. - Paste the Slash command /qubit address into Request URL.
- Add a short description, for example "Ask Qubit anywhere". A usage hint helps people:
<question> | link | model | new | routine add <schedule> :: <prompt> | routine list | status. - Save.
Add the older slash commands
The agent status, summary and Q-Notice commands each need their own entry in Slack, because Slack gives every slash command a single address. They work whether or not Qubit is on. The one condition is that /qnotice also needs the person's chat account to be linked to a QuantumOps account with a role that may issue Q-Notices, and linking goes through Qubit; see Who can use the Q-Notice commands.
- In QuantumOps, open the Messaging tab and find Slash Commands Setup. Select Copy All Endpoints. This copies the addresses for
/lunch,/brb,/online,/offline,/back,/morningsummaryand/qops. - In Slack, create each command with Create New Command and paste its address into Request URL.
- For the other older commands, use the same address as
/lunchbut end it with the command name:helpdesksummary,summary,sdm,monitor,unmonitor,research,clientsummaryorqnotice. - For
/sdm, tick the option "Escape channels, users, and links sent to your app", so that a mentioned person reaches QuantumOps in a form it can read.
Once Qubit is on for Slack, /qops answers exactly like /qubit. See Agent status commands and Summary, client and Q-Notice commands.
Give the bot its permissions
- Open OAuth & Permissions and find Bot Token Scopes.
- Make sure these scopes are present:
The Scopes list in the Setup reference leaves out files:read and files:write. Add them if you want Qubit to handle files.
- Select Reinstall to Workspace. Slack only applies new scopes after a reinstall.
- Copy the Bot User OAuth Token. If it differs from the Slack Bot Token on the Messaging tab, replace it there and save.
If a file cannot be read or posted, Qubit tells the person, for example "the Slack app needs the files:write permission β an admin must reinstall the app".
Let people message Qubit directly
- Open App Home.
- Under Show Tabs, turn the Messages Tab on.
- Tick "Allow users to send Slash commands and messages from the messages tab".
Without this, Slack tells people "Sending messages to this bot has been turned off" and direct messages never reach Qubit.
Turn Qubit on and try it
- In QuantumOps, open Configuration β Channel Assistant and tick the Slack box named "Enable the Qubit assistant in Slack". Select the Slack Save button. See Channel Assistant settings.
- In Slack, invite your app to a channel, then mention it with a question. You can also send it a direct message, type
/qubit status, or use Ask Qubit on a message.
Until the box is ticked, Qubit answers "The Qubit assistant is not enabled for this workspace."
How QuantumOps checks Slack requests
QuantumOps checks every request from Slack against the signing secret you stored, and refuses a request with a missing, wrong or stale signature. If no signing secret is stored, or the Messaging integration is off, the older slash commands answer with a message telling you to turn Messaging on, choose Slack and store the signing secret, and they stay disabled until you do. Slack's check of the events address fails for the same reason.
When something does not work
Related pages
- Channel Assistant settings: turn Qubit on and find the addresses to paste into Slack.
- Q-Director: Slack, Teams and agent mapping: store the credentials and map agents.
- Commands and private answers: what people can do with Qubit once the app is set up.
- Agent status commands: the older status commands.
- Summary, client and Q-Notice commands: the older summary, client and Q-Notice commands.
Was this helpful?
Still need help? Ask the team