Using Slash Command in Slack

This section describes the procedure on how to use Slash Command in Slack and integrate with Maximo IT.

About this task

As a Slack user, you can set Slash commands in Slack application to do the following. Slash Commands are 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 Maximo IT solutions database
  • You can search for tickets in Maximo IT based on search text
  • You can update ticket details to the Maximo IT tickets

Procedure

  1. Go to https://api.slack.com/apps and select your app to create Slash commands.
    Note: Below instructions are given just for reference. You must follow updated instructions given at 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, enter the following:
    • Command: Enter command name.

      You can either add the default command name or configure the custom command name in the Open Shift Console and in the Slack API page.

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

      where SlackProxy Service URL is the URL of the Slack Proxy Service which is installed with Manage.

    Note: The Slack Proxy Service URL must be Public and Secure.
    • 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.

      You can also configure Custom Slash commands for the above-mentioned operations. Follow the steps on Creating and adding custom slash commands.

      Note: For Slash commands to work, a Login and Synch is required from Slack to Maximo IT. The user must reinstall the application so that it is synchronized and updated. (This step is crucial and the user might need to do it multiple times in case of any connection or synchronization issue.)

What to do next

For update command, follow below steps and configure Interactivity & Shortcuts to enable Updating of the tickets in Maximo IT.
  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 Slack Proxy Service, which should be in the form: https://SlackProxy Service URL/SlackProxy/api/slack/event.

    where SlackProxy Service URL is the URL of the Slack Proxy Service which is installed with Manage.

    Note: The Slack Proxy Service URL must be Public and Secure.
    To find out how to get the Slack Proxy Service URL, see Steps to get the Slack Proxy Service URL.
  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, enter 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.
    Note: In the Select Menu dialog, enter the Options Load URL if you want to load external data in your select menus. This value would be the same as added in the Request URL of Interactivity dialog.