{"id":15714297,"url":"https://github.com/slackapi/sample-incident-management","last_synced_at":"2025-03-26T00:31:01.669Z","repository":{"id":66096315,"uuid":"299676054","full_name":"slackapi/sample-incident-management","owner":"slackapi","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-29T16:34:22.000Z","size":24,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-20T23:02:12.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slackapi.png","metadata":{"files":{"readme":"readme.MD","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-29T16:32:40.000Z","updated_at":"2021-03-30T16:56:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"36c61080-0501-4678-b76e-fe1a511768cf","html_url":"https://github.com/slackapi/sample-incident-management","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fsample-incident-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fsample-incident-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fsample-incident-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Fsample-incident-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slackapi","download_url":"https://codeload.github.com/slackapi/sample-incident-management/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566050,"owners_count":20636388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:35:52.495Z","updated_at":"2025-03-26T00:31:01.652Z","avatar_url":"https://github.com/slackapi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Incident management demo\n\nThis repo is part of the Platform development workshop, it would be highly inadvisable to use it in production as is.\n\n## Installing the app\n\n1. In your Slack workspace, create a channel for listing declared incidents. \n2. Duplicate `.env.sample` to `.env`\n3. Add the ID of the channel you created above to your .env file, after `INCIDENT_CHANNEL_ID` (hint, you can get the id by opening that channel in a browser, it's the part of the URL that begins with `C`, eg `CABC123DE`)\n4. Go to [api.slack.com/apps](https://api.slack.com/apps) and create a new app\n5. Go to OAuth and permissions and add the following Bot Token scopes: `commands`, `chat:write`,`channels:join`,`channels:manage`,`chat:write.public`,`app_mentions:read` and `reactions:write`\n6. Go to Basic Information and click the **Show** button in the Signing Secret field, then copy that string. In the .env file, paste after `SLACK_SIGNING_SECRET`\n7. Do the same for Client ID and Client secret, after `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` respectively.\n8. Back in the app configuration, go to **Interactivity \u0026 Shortcuts**, turn Interactivity to `On` and set the Request URL to `https://YOUR-DOMAIN.TLD/slack/events`\n9. On the same Interactive Components page, click the **Create New Shortcut** button and choose \"Global\"\n10. Set the fields to:\n\t* Name: `Declare incident`\n\t* Short Description: `Start the incident management process`\n\t* Callback ID: `declare_incident`\n11. On the Slash Commands page, click the **Create New Command** button \n12. Set the fields to:\n\t* Command: `/incident-bot`\n\t* Request URL: `Declare incident`\n\t* Short Description: `Start the incident management process`\n\t* Usage Hint: `[ic|sev|close]`\n  \t* Check the \"Escape channels, users, and links sent to your app\" box\n13. Deploy your code\n14. Once your server is live, go back to the app configuration, choose **Event Subscriptions**, turn Enable Events to `On` and set the Request URL to `https://YOUR-DOMAIN.TLD/slack/events`\n15. On the same Event Subscriptions page, click the **Subscribe to bot events** header and choose \"Add Bot User Event\"\n16. Choose the `app_home_opened` and `app_mention` events, then click the green \"Save Changes\" button\n\n## Database\n\nThis app requires a MySQL database to function. This SQL should create the required tables.\n\n```mysql\ncreate schema incidentbot collate utf8mb4_0900_ai_ci;\n\ncreate table incidents\n(\n\tid int auto_increment\n\t\tprimary key,\n\tname text not null,\n\tchannel_id text null,\n\tcommander text null,\n\tsev_level int default 0 not null,\n\tstate varchar(255) default 'open' not null\n);\n\ncreate table installations\n(\n\tteam_id varchar(255) null,\n\tinstallation text null\n);\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslackapi%2Fsample-incident-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslackapi%2Fsample-incident-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslackapi%2Fsample-incident-management/lists"}