Skip to main content

Ask from Slack

Nexatron answers in Slack the same way it answers in the app: every question runs as the person who asked, with their own permissions, and every write shows a card you confirm before anything changes. The Slack app is a small service your team runs; it talks to Nexatron with one token per person, never a shared account.

Setup has two halves: a Slack workspace admin installs the app once, then each person links themselves.

What you need​

  • A Slack workspace where you are allowed to install apps (workspace admin, or app installation enabled for members).
  • A Nexatron account for every person who will ask, with the systems they will ask about connected once under Settings → Connected accounts (ServiceNow, Atlassian and the other per-user sources).
  • Somewhere to run the bot process, with network access to Nexatron. It uses Slack's Socket Mode, so it needs no public address.

Workspace admin: install the app​

  1. Go to api.slack.com/apps → Create New App → From a manifest, pick the workspace, and paste the manifest that ships with the bot package (nexatron-slack, file manifest.json). Slack creates the app with the scopes, the /nexatron command and Socket Mode already set.
  2. On OAuth & Permissions, click Install to Workspace and copy the Bot User OAuth Token (xoxb-…).
  3. On Basic Information → App-Level Tokens, generate a token with the connections:write scope and copy it (xapp-…).

That is the whole Slack side. Nobody can use the bot yet: each person must be linked.

  1. In Nexatron, open Settings → API tokens and create a token named, for example, Slack. Tick Ask questions. To run actions from Slack, also tick Confirm low-risk actions and Confirm medium-risk actions (the page offers only what your role allows). Copy the token; it is shown once.
  2. Find your Slack member id (your profile → ⋮ → Copy member ID) and your workspace's team id (it starts with T and is in the workspace URL).
  3. Give both, with the token, to whoever runs the bot. The bot keeps a map of "<team id>:<member id>" to token; that map is what makes every question run as you.

If you ask before you are linked, the bot replies that your Slack account is not linked and runs nothing. There is no shared fallback.

Run the bot​

pip install nexatron-slack # or: uvx nexatron-slack
export SLACK_BOT_TOKEN=xoxb-...
export SLACK_APP_TOKEN=xapp-...
export NEXATRON_USER_TOKENS='{"T01ABCDEF:U024BE7LH":"nxa_..."}'
export NEXATRON_URL=https://api.nexatron.io/api/v1
nexatron-slack

The process exits at startup if the user map is missing, so a misconfiguration reaches the operator, not a person in Slack.

Using it​

  • /nexatron In ServiceNow, how many incidents are in each state?
  • Mention the bot in a channel: @Nexatron which Jira issues in KAN are in progress?
  • Send it a direct message with any question.
  • /nexatron list connections, /nexatron list metrics, /nexatron credits, /nexatron help.

Answers show the result, the query that ran, and an Open in Nexatron button for the full view with charts and evidence.

Writing back from Slack​

Ask for a change the way you would in the app — open an incident for the floor 3 printer, urgency high, add a work note to INC0010001 that the toner is on order, resolve INC0010001: toner replaced, comment on KAN-4 that the fix shipped.

Nexatron replies with a card: what will happen, what else it triggers (notifications, business rules), the permission it checked, and Confirm and run / Cancel buttons. Nothing is written until you confirm. The write then runs as you, with your own ServiceNow or Atlassian permissions, and the card is replaced by the receipt.

Two rules to know:

  • Only the person who asked can confirm. Anyone else's click is refused.
  • Your token needs the action scopes (ticked when you created it). Without them the card shows the refusal instead of a button. Actions that need a typed confirmation phrase cannot be confirmed from Slack; the card links you to the web app.

Your workspace's action platform must be on (it is by default; a workspace admin can switch it off).

Troubleshooting​

SymptomCause
"Your Slack account … is not linked to a Nexatron user"Your team id:member id is not in the bot's map, or the id is from a different workspace (in a shared channel, use your own workspace's team id)
"We can't reach ServiceNow as you" (or Atlassian)You have not connected that system under Settings → Connected accounts in Nexatron
A write shows a refusal instead of Confirm and runYour token lacks the action scope, or the action platform is switched off for the workspace
Confirm and run says the action has expiredAsk again; the card's plan is tied to your conversation and the bot lost its reference
The bot never answersThe bot process is not running, or it exited at startup because NEXATRON_USER_TOKENS is missing