Skip to main content

SlackBlockBuilder

This Script is part of the Slack Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.2.0 and later.

SlackBlockBuilder will format a given Slack block into a format readable by the SlackV3 integration. The script will also send the block to the given destination.

The Slack Block Kit Builder can be found here.

Script Data#


NameDescription
Script Typepython3
Tagsslack
Cortex XSOAR Version6.2.0

Dependencies#


This script uses the following commands and scripts.

  • send-notification

Inputs#


Argument NameDescription
blocks_urlThe URL copied from Slack's Block Builder.
list_nameThe name of the Cortex XSOAR list to use as the block's input.
userThe Slack user to which to send the message. Can be either an email address or a Slack user name.
channelThe Slack channel to send the message to.
channel_idThe Slack channel ID to send the message to.
taskThe task to close with the reply. If empty, then no playbook tasks will be closed.
replyEntriesTagTag to add to email reply entries.
persistentIndicates whether to use one-time entitlement or persistent entitlement.
replyThe reply to send to the user. Use the templates {user} and {response} to incorporate these in the reply. (i.e., "Thank you {user}. You have answered {response}.")
lifetimeTime until the question expires. For example - 1 day. When it expires, a default response is sent.
defaultResponseDefault response in case the question expires.
slackInstanceThe instance of SlackV3 this script should use.

Outputs#


PathDescriptionType
SlackBlockStateThe State of the response from the user will be stored under this context path.unknown

Command Example using blocks_url#


!SlackBlockBuilder blocks_url=https://app.slack.com/block-kit-builder/T0DAYMVCM#%7B%22blocks%22:%5B%7B%22type%22:%22section%22
channel=random
task=4
replyEntriesTag=slackResponse
persistent=yes

Human Readable Output using blocks_url#


Message sent to Slack successfully.
Thread ID is: 1660645689.649679

Command Example using list_name#


!SlackBlockBuilder list_name=MySlackBlocksList channel=random task=4 replyEntriesTag=slackResponse persistent=yes

Human Readable Output using list_name#


Message sent to Slack successfully.
Thread ID is: 1660645689.649679