Overview
Set up an integration that creates a ticket in Zendesk and posts a Slack notification when new device alerts within your Cumulocity IoT tenant arise with this webMethods.io Integration workflow tutorial.
Prerequisites:
Cumulocity IoT account- sign up here Sign up - Software AG Cloud.
Zendesk account
Slack account
Steps
Login to your webMethods.io Integration tenant or sign up for a free trial if you’re new (use the advanced sign up form for more options).
Create a new project or choose an existing one.
Go ahead and get started by creating a blank workflow. If you need a refresher on how to get to this point, this guide can be a great introduction.
Click the small setting icon on the Start step and choose the Cumulocity IoT trigger.
Select Alarms as a trigger and complete the authorization – connect webMethods.io Integration with your Cumulocity IoT account and choose if the workflow should be triggered by an alarm on one of your devices or by an alarm on all the devices in your Cumulocity IoT tenant.
Click Next. You should see the test trigger window.
To test your trigger, you need to perform the trigger action. Create an alarm for one of your devices in Cumulocity IoT:
Go back to the webMethods.io Integration workflow and click Test. You should see the output data from the trigger (the alarm information) which webMethods.io Integration will use to configure and test the rest of the workflow. Click Done.
5. Add the Zendesk connector to the canvas with the drag and drop feature. This automatically connects with the Cumulocity IoT trigger.
Click the small settings icon on the Zendesk connector, select create ticket as action and complete the authorization – connect webMethods.io Integration with your Zendesk account. You need to provide your Zendesk portal URL, ex. https://myzen.zendesk.com
.
Click Next.
Now you can proceed with the action configuration – in the subject field type what should be the Zendesk ticket title. You can include whatever alarm information you want from the trigger incoming data panel on the left. For this example, the ticket name can include alarm severity and device name:
{{$trigger.message.message.severity}} Cumulocity IoT device "{{$trigger.message.message.source.name}}" alarm
Type also ticket body – drag and drop the alarm message text.
Click Next and then Done.
6. You can now proceed with setting up the notification step - add the Slack connector to the canvas with the drag and drop feature. This automatically connects with the previous step.
Click on the small settings icon on the Slack connector, select Post Message to Channel as action and complete the authorization – connect webMethods.io Integration with your Slack account.
Click Next.
Now you can proceed with the action configuration – choose the Slack channel type and then type the channel ID where you want to post a message. Type the message body – use the Incoming data panel to include alarm information received from the trigger output, for example:
{{$trigger.message.message.severity}} alarm triggered for Cumulocity IoT device "{{$trigger.message.message.source.name}}" at {{$trigger.message.message.creationTime}} with message: {{$trigger.message.message.text}}.
Click Next and then Done.
7. Connect the Slack connector to the Stop step and don’t forget to save your workflow.
You can now run the workflow using the play button in the right upper corner and review the result. If you have configured the workflow correctly, after a couple of seconds you should see the newly created ticket in your Zendesk instance as well as a Slack notification posted in your channel:
Now every time a new alert is created in your Cumulocity IoT tenant, a new ticket will be automatically created, and a notification will be sent. Please note that this may take some time.
8. At the bottom-left corner of the screen you can find the Execution history of the workflow:
From here you can monitor the execution status and view error details if needed:
Please note that workflow execution logs must be enabled from the workflow execution settings: