Creating and adding Custom Slash Commands
This section describes the procedure on how to create custom Slash Commands in Slack and integrate with Maximo IT.
About this task
- 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
-
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.
- On the Slack API page, click the Slash Commands tab.
- Click Create New Command.
-
In Create New Command dialog, fill the following Command: Enter
command name of your choice to perform the three functions stated above, for
example:
For update: testupdateticket, updateticket, etc.
For ticket: testsearchticket, searchticket, etc.
For solution: testsearchsolution, searchsolution, etc.
Note: Many values can be added to perform the same functions given that they are added as single slash commands and are integrated with Maximo IT.Request URL: Enter the URL for 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.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 the user know that they can pass this information along with command. For example, in command /testupdateticket Incident_1022, testupdateticket is a custom command name and Incident_1022 is a usage hint.
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.)
- 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.
-
The custom commands added in SLACK API in the 4th step need to be integrated
with Maximo IT using the steps below:
- Go to Open Shift Console where MAS-Manage is installed.
- Open Workloads > ConfigMaps and create a new Config Map under manage project.
- Add the key-value pairs as stated in step 4 one by one in config map and
Save it. For example:
UPDATE: testupdateticket,updateticket
TICKET: testsearchticket,searchticket
SOLUTION: testsearchsolution,searchsolution
Note:Keys should always be in Uppercase whereas values should always be in lowercase. Any number of values can be added for a single key but without any spaces and separated by a comma.
A single config map can be created and all the key-value pairs can be added in it or multiple config maps can be created with a single key-value pair.
- Go to Workloads > Deployments and open the SlackProxy Pod.
- Under the Environment tab, choose Add from ConfigMap or Secret and add the Config Map(s) created above and Save it.
- Open the Pods tab beside the Environment tab and wait for the pod to restart.
- Go to Workloads > Pods and then search for SlackProxy Pod. Click on Terminal and search for the updated environment variables via env command.
-
You will see that the added values are now updated, and default values are no
longer reflected.
Note:
Once custom values are added in the Environment Tab of Deployments, you will see the default values for slash command are still present but they will no longer be applicable as the default value are overwritten with the new custom values.
You can remove the default values from the Environment tab or keep them as is. This will not affect the custom commands.