Skip to content
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

[ResponseOps][Slack Blockkit] support YAML and Hjson as input as well as JSON for blockkit body #198528

Open
pmuellr opened this issue Oct 31, 2024 · 2 comments
Labels
Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@pmuellr
Copy link
Member

pmuellr commented Oct 31, 2024

A while back for the Slack connector, we started supporting using Blockkit to create messages, rather than just the usual single Mrkdown formatted string.

Here's an example in JSON, that might be used for a recovered alert:

{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "🎉 {{rule.name}} Recovered 🎉",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "View rule: <{{rule.url}}|{{rule.name}}>"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "<{{context.alertDetailsUrl}}|View alert>"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Alert UUID: `{{alert.uuid}}`"
			}
		}
	]
}

Kinda wordy / noisy as all JSON tends to be. We could make this a little easier by supporting YAML and/or Hjson:

yaml:

blocks:
- type: header
  text:
    type: plain_text
    text: "🎉 {{rule.name}} Recovered 🎉"
    emoji: true
- type: section
  text:
    type: mrkdwn
    text: 'View rule: <{{rule.url}}|{{rule.name}}>'
- type: section
  text:
    type: mrkdwn
    text: "<{{context.alertDetailsUrl}}|View alert>"
- type: section
  text:
    type: mrkdwn
    text: 'Alert UUID: `{{alert.uuid}}`'

Hjson:

{
  blocks: [
    {
      type: header
      text: {
        type: plain_text
        text: 🎉 {{rule.name}} Recovered 🎉
        emoji: true
      }
    }
    {
      type: section
      text: {
        type: mrkdwn
        text: View rule: <{{rule.url}}|{{rule.name}}>
      }
    }
    {
      type: section
      text: {
        type: mrkdwn
        text: <{{context.alertDetailsUrl}}|View alert>
      }
    }
    {
      type: section
      text: {
        type: mrkdwn
        text: Alert UUID: `{{alert.uuid}}`
      }
    }
  ]
}
@pmuellr pmuellr added Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels Oct 31, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@pmuellr
Copy link
Member Author

pmuellr commented Oct 31, 2024

Not sure if there are other connectors, or perhaps rules, that would also benefit from this sort of ease-of-use, but I'd think anything expecting a non-trivial amount of JSON might be a candidate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Actions/ConnectorTypes Issues related to specific Connector Types on the Actions Framework Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
Development

No branches or pull requests

2 participants