Bursting to a Slack Channel

In 5.3.3, we provided the ability to send a Burst directly to a Slack Channel. This article will show the basics required to perform this function.

  1. Find or create a Burst and obtain the URL id number
  2. Create the  Dataset  to fetch Burst data from MI database  
  3. Create a Custom Script to run your Dataset (contact support@metricinsights.com for assistance)
  4. Assign the Custom Script to a Notification Schedule

NOTE:

  1. Security settings must allow a Slack Channel to access elements that are bursted to that Channel
  2. Bursting only works for public Channels 

1. Obtain Burst id (Content > Bursts)

  1. Burst id is found in the URL as shown above
  2. Schedule specified on the Burst itself is ONLY used if the Burst is sent via delivery options specified in #3
  3. Send Burst via - uncheck all if only bursting to Slack
  4. Save

If you wish to create a new Burst instead,  see details on Create New Burst (Version 5.1.2 and beyond)

As you will note in the following steps, "Burstig to Slack" ignores both fields in items  2 & 3 above

2. Create a Dataset to fetch stored Burst data from Metric Insights

  1. Data Source must be Dashboard DB (SQL)
  2. SQL statement example below with your Burst id included as marked

Basic statement

SELECT element_id, segment_value_id
FROM notification_schedule_distribution_item
WHERE notification_Schedule_distribution_id=131

To define the order in which bursted elements will appear in a Slack Channel, add ORDER BY (see example below)

ORDER BY element_id Desc;

3.    When the Dataset is Enabled and Published, the values returned with be the Element IDs and Dimension Values specified in your Burst

3. Configure Automation Script for Bursting to Slack

3.1. Admin > Utilities > Custom Scripts

Specify basic Script Information:

  1. Name of the Script
  2. External Application Name will default
    • Learn about configuring your Metric Insights instance for API access from Set up API Access
  3. Authentication User can be modified but must be an Admin

Save to display full Script Editor

3.2. Custom Scripts Editor > Editor Tab

  1. Go to the Editor tab
  2. Enter the code for your Script.
    • Alternatively, contact support@metricinsights.com to get the code

3.3. Custom Scripts Editor > Info Tab

  1. Set Custom Script is to 'enabled'
  2. Are Parameters Required must be set to 'yes'
  3. Select [+ Add Parameter]

3.4. Add Script Parameter

 Add the required Script Parameters. The following example is done for the "channel" parameter:

  1. Name set to: "channel"
  2. Type set to: "String"
  3. Default Value (optional): Name of default Slack Channel for this Burst
  4. Available Values: Names of all Slack Channels to receive this Burst (View in 3.3 below)
  5. Required: must be set to "yes"

Save to return to the full editor where the added Parameters and Parameter Sets will now appear

3.5. Verify the Parameters

Parameter names must be exactly the same as those specified in the Custom Script

You can enter the parameters for:

  1. Burst Description
  2. Burst Name
  3. Slack Channel
  4. Dataset Name

3.6. Add Parameter Sets

Multiple Parameter Sets can be added.

Each Set will allow the same Automation Script to be used to send various Content with separate Bursts to different Slack Channels.

On the Add Parameter Set pop-up indicate:

  1. Parameter Set Name
  2. channel: specify the name of the Channel where the Burst is to be delivered
  3. burstName: provide the exact Name of the Burst that you want to distribute via Slack
  4. burstDescription: additional text information that is sent alongside Tiles to a Slack Channel
  5. datasetName: enter the name of the Report that will fetch data for Bursting
  6. If set to Default, this Parameter set will be used by default during the Automation Script run.

4. Select or Add a Notification Schedule for Slack Distribution

Upon completing Script configuration, associate the Script with a Notification Schedule.

You can select from the list of already available schedules or create one.

Go to Admin > Notification Schedule

  1. Choose any of the existing Schedules
  2. Alternatively, click [+New Notification Schedule]

5. Add the Automation Script to your Notification Schedule

In Notification Schedule Editor

  1. Go to the Run Scripts tab
  2. Click [+Add Script]
  3. Choose Script to be added
  4. Click [Save]

6. Verify Slack Distribution

After Content Bursting is executed according to the Notification Schedule, the Slack Channel will contain the following information:

  1. Burst Name
  2. Burst Description
  3. Tile Name
  4. Last Measurement Value and Time (for Metrics)
  5. Tile Description
  6. Preview Image

0 Comments

Add your comment

E-Mail me when someone replies to this comment