Browse Snap-Ins
slack-configurable-post-message
Slack Notifier Bot
by DevRev

Slack configurable notifier

The Slack configurable notifier snap-in sends data to a specified Slack channel daily at 8 AM PST, based on the user's configured settings.

Configurations

  • Slack Personal Access Token (PAT) - This token authenticates Slack and is utilized to post messages to the specified Slack channel.

  • Data configuration - This is the configuration that the user must define, determining how messages are posted to the specified Slack channel.

  • Slack channel ID - The ID of the Slack channel where the blocker tickets report will be posted.

Features

  • Fetches all configured data.
  • Formats the data into message blocks for posting in the Slack channel.
  • Posts the formatted report to the specified channel.
  • To manually trigger the snap-in, type /postslackmessage in the Discussions tab and press Enter. It is recommended to refresh the page after installing the snap-in before running the command.

How to Use

  1. Configure the Slack Personal Access Token, Data Configuration and Slack Channel ID.
  2. Verify if the Data Configuration is a vaid JSON parseable string and all the queries are working as intended.
  3. Make sure that any variable name in either title or message is same as that of column names in query output schema.
  4. Install the snap-in. It will fetch all configured data every 24 hours and post a report to the configured Slack channel.
  5. To stop the notifications, simply deactivate or delete the snap-in from DevRev.

Example: Data Configuration

  1. Each array item in data configuration below is taken as a separate message block.
  2. Adding the is_divider: true block adds a divider between the previous block and the next block.
  3. Adding is_code: true to any block, posts it as a code_block in slack.
  4. Adding list_type: "ordered" to any block, posts the data in that block as a ordered list. By default it is unordered.
  5. If you add any variable name to currency_field, it gets formatted and gets appended by currency_type default value of which is $. Make sure to add only variables of type integer to this array, otherwise they doesn't get formatted. Example: 1000000 gets converted to $1.00M
  6. If you want to add any field or variable which can be retrieved from atoms.get API, you can specify that json path in the variable starting with atom.. Example variable which can be added to title/message: {atom.account.display_id} or {atom.title}. Make sure the path to the item is correct, otherwise it would be replaced by NaN.
  7. Make sure if any variable of type atom is added in title/message, it's mandatory to retrieve object_id as a part of query and the name of that paticular id column should be specified as {"atom_call_column": "id_column_name"}
  8. For adding any hyperlink, you need to add URL and text as done here: <{URL}|{text}>
  9. For any further formatting, it should be handled in the query itself and the snap-in will replace the variable as it.
dataConfig = [
{
"title": "In last 24hrs:",
"is_code": true
},
{
"is_divider": true
},
{
"title": "Top 3 Opportunities upstaged for this quarter",
"message": "{fullname} | {acv} | <{opp_url}|{display_id}> | Moved from {stage_prev} to {curr_stage}",
"query": "Please write your query here and make sure to write only a DuckDB specific query. Also make sure that your query use the table name as it is mentioned in tables array. Don't include 'system.' or any other prefix in table names",
"tables": [],
"noDataMessage": ""
"currency_fields": ["acv"],
"currency_type": "$",
"list_type": "ordered"
}
]