Improving our Slack integration
Last year I posted about Integrating Clarify/Dovetail with your group chat app. That post was around the time we started using Slack for our group chat.
At that time, I was using Slack’s simple webservice to post messages about cases.
For example, case dispatch notifications looked like:
Simple. But not very detailed.
Rather than just using Slack’s simple web service, I’m now using their Attachments, which allow for more richly formatted messages.
Notice there’s now much more information available, including:
- Top-level message (In this case, “Case Dispatch Notification”)
- Case ID
- Contact and Site Name
- Case title (which links to the case in Dovetail Agent)
- Link to the case in Dovetail Mobile
And it’s easy to add whatever other relevant information in there that I would like.
Business Rule Action
The business rule that fires on case dispatch now calls the CaseMessage.bat file, like so:
C:\Dovetail\RuleManagerActions\slack\casemessage.bat [Object ID] dovetail “Case Dispatch Notification”
To that BAT file, we pass in the case ID, the Slack channel to post to, and the top level message.
That BAT file turns around and calls a Powershell script, which does all the heavy lifting.
There’s also a similar nicely-formatted message when new knowledgebase articles (solutions) get created:
This notifies our team that a new article is available, and allows us to have some discussions/feedback around it, right in Slack.
The business rule that creates this Slack message calls the SolutionMessage.bat file:
C:\Dovetail\RuleManagerActions\slack\SolutionMessage.bat [Object ID] dovetail “Solution [Object ID] created by [Logger]”
Business Rule Delay
The business rule fires on the solution creation, but with a delay of 30 minutes. This gives the solution author a bit of time to edit it before the team is notified.
All of my code is freely available on Github.
You’ll need to tweak it for your environment, setting your URLs to Dovetail Agent and Mobile, as well as your Slack URLs.
You may also wish to edit it to include whatever data is relevant for your team.
These richer messages provide more data and context, and make it easier for our team to determine if they need to review or accept one of these cases, without necessarily having to leave the Slack app.