Skip to content

Commit

Permalink
Merge pull request #7 from industrydive/TECH-7709-add-tech-members-to…
Browse files Browse the repository at this point in the history
…-incident-channels

Tech 7709 add tech members to incident channels
  • Loading branch information
sw3dish authored Jan 28, 2020
2 parents d77060f + 0698388 commit 7021b86
Show file tree
Hide file tree
Showing 9 changed files with 472 additions and 762 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,19 @@ Below is a step by step series of examples that tell you how to get a developmen
* You can follow the instructions [here](https://cloud.google.com/resource-manager/docs/creating-managing-projects) to set up a Google Cloud project if you do not already have one.
* In the Google Cloud Console navigate to APIs & Services -> Dashboard and enable the Cloud Functions API if you haven't already done so.

2. You must clone this repo.
2. Clone this repo.

3. Create your Slack app:
* Navigate to https://api.slack.com/apps and create your new Slack app.
* In your new app, navigate to `Slash Commands` and create a new Slash Command. You may call this whatever you like. Place `https://placeholder.com` in the Request URL section for now. Remember where this is because you will have to replace this with the HTTP trigger endpoint for the `incidentSlashCommand` function once you have completed step 4.
* In your new app, navigate to and enable `Interactive Components`. Place `https://placeholder.com` in the Request URL section for now. Remember where this is because you will have to replace this with the HTTP trigger endpoint for the `handleIncidentForm` function once you have completed step 4.
* In your new app, navigate to `Bots` and add a new bot user. You may call it whatever you would like.
* Navigate to `OAuth & Permission -> Scopes` and add the `channels:write` and the `chat:write:bot` permissions.
* Navigate to `OAuth & Permission -> Scopes` and under the Bot Token scopes, add the `channels:manage`, `chat:write`, `im:write`, and `usergroups:read` permissions.

4. You must set your environment variables and deploy your Cloud Functions.
* Rename `example.env.yaml` to `.env.yaml` and input your environment variables.

NOTE: For us, the three users that are always added to the incident channel upon creation are the members of our product
team. You can follow this [link](https://help.workast.com/hc/en-us/articles/360027461274-How-to-find-a-Slack-user-ID) to
easily find the user IDs for the members of your team that you would like to include.

NOTE: When the incident channel gets created, it invites all of the members of the usergroup that is specified in the env.yml file. For more info on usergroups and how to manage them see the [following](https://slack.com/help/articles/212906697-Create-a-user-group) and the example.env.yml file that is included in this repo.

* Now you can deploy each of your cloud functions by following the instructions in the [deployment section](#deploying-the-cloud-functions)

Expand Down
6 changes: 2 additions & 4 deletions example.env.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
SLACK_TOKEN: This can be found under Basic Information -> App Credentials -> Verification Token in your app
INCIDENT_BOT_TOKEN: This can be found under OAuth & Permissions -> Bot User OAuth Access Token and begins with 'xobp'
USER_SLACK_TOKEN: This can be found under OAuth & Permissions -> OAuth Access Token and begins with 'xoxp'
INCIDENT_DOC_URL: This is a link to additional guidelines for how to handle the incident. Will be included in channel description.
USER_ID_1: User ID of first person that will be added to incident channel
USER_ID_2: User ID of second person that will be added to incident channel
USER_ID_3: User ID of third person that will be added to incident channel
INCIDENT_GROUP_ID: This is the ID for the usergroup that you would like to add to the channel on creation. The easiest way to get this
is to go the the usergroup in the web version of slack and take the last string of the url.
Loading

0 comments on commit 7021b86

Please sign in to comment.