Creating Custom SlackAsk Blocks
Please note that much of this tutorial can be done automatically for you by using the SlackBlockBuilder
. If you wish to create your own scripts, then this article is relevant for you.
To use custom blocks in SlackV3, you will first need to define the block structure in JSON format. Slack's Block Kit Builder (https://app.slack.com/block-kit-builder/) can be used to design and generate the JSON structure.
Next, you will need to generate the entitlement which will be used to tie the reply back to the playbook. Please refer to the entitlement article for more information.
Once you have the entitlement string, you will need to create the following:
This JSON string will need to be placed in a very specific part of each element of your blocks as shown below:
Once the blocks have the correct entitlements, you may prepare the arguments to send the blocks as follows:
Finally, you can send your blocks using the send-notification
command along with the arguments you have formatted above.