Use case: Jira Confluence page search returns excerpt or full article via Workbot for Slack
Let’s go through an example use case to illustrate what you can do with updating messages! If you haven’t already, check out the Updating bot messages blog post to learn how it works.
As the rather wordy title suggests, this collection of recipes commands Workbot to search the user’s Confluence for articles, and then post excerpts of the articles (if any are found from the search) to Slack via Workbot.
- Search for articles in Confluence & return excerpts if any exist
- Clear excerpt
- Show entire article
- Clear entire article
The user can view the full article, or clear the excerpt. The user can also clear the full article (presumably after reading it).
1. Search for articles in Confluence & return excerpts if any exist
Invoking recipe 1, two articles are found after a search query ‘workbot’ is keyed in:
For a tidy conversation history, the option of seeing the entire article or clearing the excerpt is given to the user via 2 buttons. These buttons call either recipes 2 or 3 – ‘Clear’ or ‘Show entire article’ respectively, depending on which is clicked by the user.
An important note: the buttons in the excerpts are posted by the post command reply action in step 10 of recipe 1. When triggered by these buttons, the message IDs in the recipes (recipes 2 & 3) will point to the message that contain these buttons. This is why we don’t need to pass the message ID name-value pair via the command input values field to update the message.
2. Clear excerpt
Clicking on the ‘Clear’ button updates the message by clearing the excerpt, replacing it with a message that includes the name of the article that was just cleared.
This not only de-clutters the page, but also provides the user with a useful reference to which article was cleared.
The post message action in this recipe utilizes the message ID from the post command trigger since it is invoked from the ‘Clear’ button click.
3. Show entire article
Clicking on the ‘Show entire article’ button retrieves the full article and updates the excerpt with the full article, along with a button to clear the article.
While being able to read the article from Slack is pretty neat, the wall-of-text very quickly clutters the chat history with the bot. That’s why a ‘Clear’ button is included if the user wants to clear the article after reading it.
The post message action in this recipe utilizes the message ID from the post command trigger since it is invoked from the ‘See entire article’ button click.
4. Clear entire article
Like clearing the excerpt, clicking the ‘Clear’ button replaces the full article with a feedback message that includes the name of the article for the user’s reference.
It also offers the user some useful information if another search is to be done, including a ‘Search’ button to kick-off another search query.
Once again, the post message action in this recipe utilizes the message ID from the post command trigger since it is invoked from the ‘Clear article’ button click.
Upgrade your bot messages – by updating them!
Take your messages to the next level: de-clutter conversations, add/remove buttons, expand/contract messages – clone these recipes to your workspace and try them out!