Workflows / Github / issues

Github Issues Opened Notification to Slack & Email

Use the Github integration by MagicBell to setup a workflow when issues triggers in Github.

Connect Github to MagicBell to receive events and trigger workflows. This guide uses the MagicBell CLI.

Add the Github integration

Save your Github webhook signing secret in MagicBell. See GitHub webhooks.

magicbell integration save_github \
  --data '{"webhook_signing_secret":"your_secret_here"}'

Copy the ID from the response and use it to build your webhook URL:

https://api.magicbell.com/v2/integrations/github/webhooks/incoming/{id}

Setup the webhook

  • Setup a webhook in Github with the URL from the last step.
  • Select the issues event.
  • If you already have a webhook configured, make sure it includes this event.

Add a workflow

Create a workflow that triggers automatically when Github sends this event.

Workflow key

Use this key to trigger the workflow when Github sends a issues event:

integration.github.issues

Filter by action: GitHub sends the event type in the header and the action in the payload body. Use an if condition to filter for the opened action:

"if": "payload.action == 'opened'"

Example workflow

Notify the team on Slack when a new issue is opened. Include issue details and a link to triage quickly.

{
  "key": "integration.github.issues",
  "steps": [
    {
      "if": "payload.action == 'opened'",
      "command": "broadcast",
      "input": {
        "action_url": "{{payload.issue.html_url}}",
        "content": "Issue #{{payload.issue.number}} opened by {{payload.sender.login}} in {{payload.repository.full_name}}.",
        "overrides": {
          "providers": {
            "slack": {}
          }
        },
        "recipients": [
          {
            "external_id": "engineering-team"
          }
        ],
        "title": "New issue: {{payload.issue.title}}"
      }
    }
  ]
}

Save with the CLI

Use the MagicBell CLI to save this workflow to your project. You can also use the Workflows API endpoint instead.

magicbell workflow save \
  --data '{"key":"integration.github.issues","steps":[{"if":"payload.action == 'opened'","command":"broadcast","input":{"action_url":"{{payload.issue.html_url}}","content":"Issue #{{payload.issue.number}} opened by {{payload.sender.login}} in {{payload.repository.full_name}}.","overrides":{"providers":{"slack":{}}},"recipients":[{"external_id":"engineering-team"}],"title":"New issue: {{payload.issue.title}}"}}]}'

Event payload

Sample payload for the issues event. Use liquid templates to access fields in your workflow.

{
  "action": "opened",
  "issue": {
    "assignee": null,
    "assignees": [],
    "author_association": "CONTRIBUTOR",
    "body": "When I try to start the application, it crashes with an error message.\n\n## Steps to reproduce\n1. Run `npm start`\n2. Wait for compilation\n3. Application crashes\n\n## Expected behavior\nApplication should start normally.",
    "closed_at": null,
    "comments": 0,
    "comments_url": "https://api.github.com/repos/acme/project/issues/42/comments",
    "created_at": "2025-01-15T10:30:00Z",
    "events_url": "https://api.github.com/repos/acme/project/issues/42/events",
    "html_url": "https://github.com/acme/project/issues/42",
    "id": 1234567890,
    "labels": [
      {
        "color": "d73a4a",
        "description": "Something isn't working",
        "id": 1,
        "name": "bug",
        "node_id": "MDU6TGFiZWwx"
      }
    ],
    "labels_url": "https://api.github.com/repos/acme/project/issues/42/labels{/name}",
    "locked": false,
    "milestone": null,
    "node_id": "I_kwDOABC123",
    "number": 42,
    "state": "open",
    "title": "Bug: Application crashes on startup",
    "updated_at": "2025-01-15T10:30:00Z",
    "user": {
      "avatar_url": "https://avatars.githubusercontent.com/u/123456",
      "html_url": "https://github.com/jane-developer",
      "id": 123456,
      "login": "jane-developer",
      "node_id": "MDQ6VXNlcjEyMzQ1Ng==",
      "type": "User"
    }
  },
  "organization": {
    "avatar_url": "https://avatars.githubusercontent.com/u/111111",
    "description": "Building great software",
    "id": 111111,
    "login": "acme",
    "node_id": "MDEyOk9yZ2FuaXphdGlvbjExMTExMQ=="
  },
  "repository": {
    "created_at": "2020-01-01T00:00:00Z",
    "default_branch": "main",
    "description": "A sample project",
    "fork": false,
    "full_name": "acme/project",
    "html_url": "https://github.com/acme/project",
    "id": 987654321,
    "language": "TypeScript",
    "name": "project",
    "node_id": "MDEwOlJlcG9zaXRvcnk5ODc2NTQzMjE=",
    "open_issues_count": 42,
    "owner": {
      "avatar_url": "https://avatars.githubusercontent.com/u/111111",
      "html_url": "https://github.com/acme",
      "id": 111111,
      "login": "acme",
      "type": "Organization"
    },
    "private": false,
    "pushed_at": "2025-01-15T09:00:00Z",
    "updated_at": "2025-01-15T10:30:00Z",
    "visibility": "public"
  },
  "sender": {
    "avatar_url": "https://avatars.githubusercontent.com/u/123456",
    "html_url": "https://github.com/jane-developer",
    "id": 123456,
    "login": "jane-developer",
    "node_id": "MDQ6VXNlcjEyMzQ1Ng==",
    "type": "User"
  }
}
View all Github workflows →