How to create a Slash Command to start processes

HEFLO allows you to integrate its platform with other applications. In this article we’re going to show you how to open work items through a Slash Command in Slack.

For this we’ll use a simple demonstration support process.

Adapting processes

Add the “Message” initiator event, located in the BPMN toolbox on the left, to the drawing area or process line and connect it with activity “Analyzing and Solving the Demand”.

You need to create a “TEXT” type field in the process, which will receive the parameter coming from Slack. To do this, add a “Data Input” element and create the new property.

 

Set the field to multi-line.

 

Learn more about creating forms in Form Creation.

Configuring integration in HEFLO

Select the “Message” initiator and go to the properties tab on the right, then, in the Connector attribute, select the “Web Service” option.

 

Click on the “Configure WEB SERVICE” button, in the window that will open, complete the following parameters:

Change the “Content Type” field to “ENCODED FORM URL (X-WWW-FORM-URLENCODED)”.

Slack by default sends a parameter called “text” in the integration, we need to create this parameter in HEFLO and bind it to a work item field, in our example we will link it to the “Problem” field, created at the beginning of the article.

 

Click the “Click here to generate the key” link in the “Access key” attribute, you will be directed to the “Environment management” screen, navigate to the “API keys” area and click “Add new key”.

 

In the window that will open click “Close and Download”. The “Key” field represents the user and the “Secret” password.

 

Important: HEFLO downloads a .txt file with the data from the above window so you don’t lose this information, you won’t be able to change the password, if you need it, you’ll need to generate a new key and update the calling app url, for this, store it in a secure folder.

The whole integration will be secure because it uses the https protocol that guarantees an encrypted channel between the applications, in addition to the Key and Secret password managed in HEFLO.

Click “Confirm” in the “Configure Web Service” window. Once this is done, HEFLO creates the test and production links for your process, which will be used in Slack to make the calls.

 

The production link will be enabled and displayed only when the process automation is published, but you can view it by clicking “Click here to view the URL now”.

 

Creating Applications in Slack

Go to Slack, click on your user ID, then on “Administration” and then “Manage apps”.

 

 

On the screen that will open, click “Build” and then “Your Apps”.

 

Click “Create New App” and in the window that will pop up fill in the fields “App name”, with the name of your application in slack and “Development Slack Workspace” with your development team, then click on “Create App”.

 

In the screen that will be displayed choose “Slash commands”, then click on “Create New Command” and fill in the parameters as shown below.

Leave the “Request URL” parameter blank for now and fill in the other fields.

For the field “Request URL” we need to make some adjustments to the url generated by HEFLO.

Adjusting HEFLO Test URLs

Re-access your process in HEFLO and copy the “Test URL” in the initiator properties to “Message”.

 

Paste the url into a text file and open the .txt file that was downloaded on your machine with the Key and Password.

 

Now you need to put “https: //” the value of the Key attribute, then put “:” and include the Password, and to finish your url insert an “@” after the Password as shown in the image below.

 

Now with our url set, let’s go back to Slack to finish setting up our slash command.

 

Finishing Slack application configuration

Paste the new url into the “Request URL” field and then click “Save”.

Your command will be created just like the image below.

 

Now it’s necessary to install the application in Slack to enable the users to use it.

 

Once installed you can immediately create work items by slash command. Type / Start-Support and then the Description that will populate the Problem field in your work item.

Click “Enter” to perform the call integration and you will receive the HEFLO answer.

 

Notice that test item number 15 was created.

 

Checking the test item created in HEFLO

To view the item, access your process in HEFLO, right click on the message initiator, then on “Tests” and then on the item created by Slack.

 

Note that the description entered in the slash command matches the value of the “Problem” field in your work item.

 

Creating Items in Production

To start creating items in production by slash command you need to access your process in HEFLO and publish the automation. To do this, click on the “Actions” icon in the property menu and then on “Publish Automation”.

Re-adjust the url using the production link now. Select the message initiator and in the properties copy the production link.

The Key and Password still remain the same so just replace the url in the test link with the production link.

 

Updating Slack with URL production

Re-access Slack and edit your slash command by entering the new url and then saving.

You can now use your Slash command to create workable items in your HEFLO workspace.

Important: We recommend that you keep two commands in Slack, one for testing and the other for production.

See more in this Tutorial: How to create a Slash Command in Slack

Was this article helpful?

Related Articles