Using Slash Command in Slack

This section describes the procedure on how to use Slash Command in Slack and integrate with IBM Control Desk.

About this task

As a Slack users, you can give Slash command in Slack application to do the following. Slash Commands is given in your Slack application by typing a command (string) into the message composer box. For more details, see Slash command.
  • You can search solutions in the ICD solutions database
  • You can search for tickets in the ICD based on search text
  • You can update ticket details to the ICD tickets

Procedure

  1. Go to https://api.slack.com/apps and select your app to create Slash command.
    Note: Below instructions are given just for reference, you must follow updated instructions given in https://api.slack.com/apps.
  2. On the Slack API page, click the Slash Commands tab.
  3. Click Create New Command.
  4. In Create New Command dialog, fill the following:
    • Command: Enter command name, for example: icdupdateticket, icdsearchticket, or icdsearchsolution.

      You can configure the command name in the config.js file of the Service Portal.

    • Request URL: Enter the URL for your Service Portal, for example: https://Service Portal NODE IP:Port/api/slack/event

      where Service Portal NODE IP:Port is the IP address and the port number of your Service Portal server.

    • Short Description: Enter short description about the command.
    • Usage Hint: Enter the usage hint for the command, for example ticket_ID for Update command, search_text for Search Ticket and Search Solution commands.

      Usage hint is given to help user know that they can pass this information along with command, for examples in command /icdupdateticket Incident_1022, icdupdateticket is a command name and Incident_1022 is a usage hint.

What to do next

For update command, follow below steps and configure Interactivity & Shortcuts to enable Updating of the tickets in ICD.
  1. On the Slack API page, click Interactivity & Shortcuts tab.
  2. Enable button for Interactivity and toggle to On.
  3. In the Request URL, enter the URL of your Service Portal, for example: https://Service Portal NODE IP:Port/api/slack/event.

    where Service Portal NODE IP:Port is the IP address and the port number of your Service Portal server.

  4. Click Create New Shortcut, a Create a shortcut dialog will open.
  5. In Create a shortcut dialog, select On messages box and click Next to open Details dialog box.
  6. In the Details dialog, fill the following:
    • Name: Enter action name, for example Update Ticket.
    • Short Description: Enter short description, for example Update Ticket.
    • Callback ID: This must be filled as ticket_update.