-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new slack "blocks" instead of "attachments" #166
Comments
It looks like When you say it's "broken", what do you mean? Are there any hints in the st2chatops logs? Edit: |
By broken, I mean that if I include an actions type element in the list of blocks, it does not render in slack. |
It's not deprecated, but it is legacy until they can get blocks ready enough to deprecate it. A quote from Creating rich message layouts
And the most thorough advice that basically says it's deprecated even though it's not deprecated...
And the big caveat just after that section explaining why attachments are NOT completely deprecated (yet).
And another quote from the top of Reference: Secondary attachments
|
I think we're talking past each other. The new Is there anything useful in the logs when it fails? Does anything show up in Slack when you try to use Also, the Slack adapter doesn't do a whole lot of munging when it sees an |
Putting blocks under attachments was the only way I could get any blocks to work.
When I used the workaround of putting blocks under attachments, iirc, there were no error messages in the log, but the actions never showed up in Slack. |
Does something like this work? Can you test this out? It's straight out of the Slack docs: result:
format: ...
extra:
slack:
icon_emoji: ":jira:"
username: Jira Bot
attachments:
- blocks:
- type: section
text:
type: mrkdwn
text: "Danny Torrence left the following review for your property:"
- type: divider
- type: section
block_id: section567
text:
type: mrkdwn
text: >
<https://example.com|Overlook Hotel>
:star:
Doors had too many axe holes, guest in room 237 was far too rowdy, whole place felt stuck in the 1920s.
accessory:
type: image
image_url: https://is5-ssl.mzstatic.com/image/thumb/Purple3/v4/d3/72/5c/d3725c8f-c642-5d69-1904-aa36e4297885/source/256x256bb.jpg
alt_text: Haunted hotel image
- type: divider
- type: section
block_id: section789
fields:
- type: mrkdwn
text: "*Average Rating*\n1.0" |
"attachments" is now legacy. I'm filing this issue so that this is on the radar to figure out what that means for our hubot.
https://api.slack.com/reference/messaging/blocks
https://api.slack.com/reference/messaging/attachments#legacy_fields
Playing around, I can use do something like:
however, this failed
Other stuff might be broken as well.
The text was updated successfully, but these errors were encountered: