When a helpdesk ticket is created in a 3rd party system, send an actionable notification in Slack that allows the user to claim the ticket or apply a label.
This app blueprint assumes that your 3rd party ticketing system has outgoing webhooks i.e. it sends an HTTP request to a customizable URL when certain events happen. If your helpdesk system does not have outgoing webhooks, you may be able to periodically poll for new tickets and follow the process described below.
The app has an endpoint (/incoming
) that receives webhooks from the ticketing system whenever a new ticket is created.
This app blueprint takes a simplistic approach in assuming that there is only one endpoint for all types of tickets and that the notifications are pushed into Slack using a single incoming webhook. For more complex systems, consider using a bot that generates a webhook per channel.
When a webhook is received from your ticketing system, the details of the ticket (such as the title, description, date, author and assignee) are parsed out of the JSON payload. These details are passed into a message template for the Slack notification. The template places the details into a well-formatted Slack message that has author, title, text and attachment fields. A set of actions (a message button and multiple message menus) are also added to the message. The callback ID of each message action is set to the ticket ID in the 3rd party system so that any actions a user takes on Slack can be mapped back to the 3rd party system.
The app has an endpoint (/interactive-message
) that receives the information from a user action.
When a user clicks on a button or makes a selection from a menu in the message, Slack will send a POST request to the Interactive Message request URL provided in the app settings. This request will include a action_id
, a response_url
and information about the user who took the action. The action_id
(which was previously set to be the same as the ticket ID) can be used to map the action back to a specific ticket. The app will leverage your ticketing system's API to make the necessary updates. Once the update has completed, a status update can be sent back to Slack using the response_url
. The response_url
allows the app to update the content of the message the action was taken on using an HTTP request with a JSON payload.
To include message actions, you'll need to enable Interactive Messages in the app settings and supply a URL where Slack can send the button click event.
The account binding template will help you bind Slack users to users in your 3rd party system to ensure that all existing authorizations are well respected.