A Slack command to make the process of scheduling a PagerDuty override more efficient, encouraged, and documented.
Time estimate: 10 minutes to setup
Before you begin, you need:
- A Transposit account with a forked version of the application
- A Slack workspace where you can create and install apps
- A PagerDuty account with a schedule
After you have forked the application and logged into PagerDuty:
- In PagerDuty, navigate to the schedule you want use with the Slack command, the url will look something like this: https://example.pagerduty.com/schedules#ABCDEFG
- Copy the schedule ID at the end of the URL (E.g. ABCDEFG for the URL above)
- In Transposit, the
post_schedules_by_id_overrides
JavaScript operation, paste it into the string that says<SCHEDULE ID HERE>
- Under Deploy > Production Keys, select Add key, and follow the instructions in the link listed for how to get a PagerDuty REST API key
- Lastly in Transposit, under Code > Auth & settings > Keys, select Connect, and the option to copy an existing authorization, so you don't need to copy the API key again
- Create a new app here in Slack
- Copy the URL for your webhook in Transposit under Deploy > Endpoints, under the deploy as webhook checkbox, similar to this:
https://pagerduty-scheduler-18c5o.transposit.io/api/v1/execute-http/webhook?api_key=abcdefghijklmnop123
- In your Slack App configure page, select Interactive Components, turn on interactivity, and paste in the URL you copied from Transposit into the Request URL
- In your Slack App configure page, select Slash Commands, and select Create New Command
- Name the command (E.g.
/request-override
), paste the same webhook URL from before as the Request URL, give it a short description for your team to see, and save it - In your Slack App configure page, select Install App, and allow permission to access your workspace
- You should now be able to use the
/request-override
command in your workspace
Note: Each user who uses the app will get prompted to add their PagerDuty user ID
- Team members could be asked for coverage privately instead of a channel
- Integrate with Google Calendar
- Include multiple PagerDuty schedules
- Be able to view and edit schedules in Slack