As an IT professional, you're tasked with safeguarding your business from any tech disasters, whether it's security issues, errors, or troubleshooting for your coworkers. That usually means your team has an on-call schedule, so there's always someone available to help.
Those on-call shifts can sneak up on you though, especially if you're in the midst of projects. Zapier can help you keep your team—and your company—up-to-date on your on-call shifts without breaking your focus.
We'll show you how you can create a Zap—what we call our automated workflows—that announces the upcoming on-call schedule in your team chat app.
You'll need a Zapier account to use the workflows in this piece. If you don't have an account yet, it's free to get started.
How to create an on-call notification bot with PagerDuty
For this tutorial, we'll show you how to create an on-call notification bot with PagerDuty. If you don't use PagerDuty or another incident response platform to manage your on-call schedule, you can use your calendar instead.
Before you begin
Make sure you have an on-call schedule created in PagerDuty with users assigned. You'll also need to make sure you've created an API access key within your PagerDuty account. You'll need this key to connect PagerDuty with Zapier.
To create your access key, log in to your PagerDuty account. Once you've signed in, click on Integrations in the top menu and select API Access Keys.
You'll see a list of any existing API keys. Click on + Create New API Key.
Give your API Key a name and click Create Key.
PagerDuty will generate an API key for you. This is the only time PagerDuty will show you your access key, so I recommend saving it to a password manager to reference later.
We'll refer back to this key later in this tutorial.
Create your Schedule trigger
When you're ready to create your Zap, sign in to your Zapier account and click Create Zap to navigate to the Zap editor.
You'll be prompted to create your trigger—the event that starts your Zap. Since we want our Zap to run on a recurring schedule, we'll select Schedule as our trigger.
Next, you'll need to select your event—how often you want Schedule to run. For our example, we'll select Every Week, but you can select whatever cadence you'd like.
Now we'll select the day of the week we want our Zap to run and the time.
Zapier defaults to on-the-hour increments, but if you want something to run at, say, 10:30 a.m., you can type that in instead.
Just click on the Custom tab and type in the time you want your Zap to run. Zapier can handle both 12- and 24-hour formats. Just make sure to specify whether it's a.m. or p.m. if you're using the 12-hour format. Click Continue when you're done.
Next, click on Test Trigger.
Zapier will look for a day of the week (or month or year). It will default to the time you tested your Zap, but don't worry if it doesn't match your specifications. Once you publish your Zap, it will run on the schedule you configured.
Add your PagerDuty search step
Next, it's time to add an action, which is the event your Zap will perform once it's triggered. Our action for this Zap will be a search step.
Select PagerDuty and then select Find User on Call as your Event. Click Continue.
Certain apps with Zapier integrations support search steps. Check the App Directory to see if your app has a search action available. Pay attention to words like Find, Search, or Lookup in the action description.
Next, select your PagerDuty account. If you haven't connected PagerDuty to Zapier before, click + Connect a new account.
For each app you connect, Zapier will ask for a general set of permissions which allows you to be flexible with your Zaps. The only actions Zapier takes on your app accounts are those a given Zap needs to accomplish what you've set up.
Type in your account name and the API key you saved earlier, and click Yes, Continue.
Once your account is connected, click Continue.
Next, we'll set up our PagerDuty search. Click on the dropdown beneath the Schedule field and select the existing on-call schedule you want to search within.
Under Start Time, you'll set up the start time for the events you want to search. For example, if you want to search for an on-call shift that starts the day after your Zap runs, you'd type in +1 day. That way, you're telling your team who is on the schedule for the next day.
You'll set up your End Time similarly as well.
Next, we'll configure what we want Zapier to do if our PagerDuty search fails.
Under Should this step be considered a "success" when nothing is found, this is set to Yes by default. You'd use this if you wanted to create branching logic using Paths. For example, if you wanted your Zap to take specific actions depending on whether Zapier finds a user on call in PagerDuty, you could use Paths.
For the purpose of this tutorial, we're going to select No.
Now it's time to test our search step. I recommend testing this because we'll use the results of this search to set up the rest of our Zap. Click Test & review.
Pay close attention to your search results. You'll see a field called _zap_search_was_found_status. If your search was successful, the status will be true. If you see false instead and weren't expecting that, go back to the previous step, adjust your search parameters, and retest. Once you're satisfied, click Continue.
Note: If you want your notification to include the person who is on-call this weekend and next weekend, you can add a second search action. Just repeat these steps and adjust your search criteria appropriately.
Add your notification action
Now we'll create our notification step. For this example, we're using Slack, but you can use any chat app with a Zapier integration.
Select Slack as your action app and Send Channel Message as the action event and click Continue.
Next, select your Slack account from the dropdown menu, or connect your workspace if you haven't connected Slack to Zapier before. Once you're done, click Continue.
Then, select the channel you want to send your message to.
Under Message Text, you can customize how you want your notification to look. You can use a combination of text—which will appear the same each time your Zap runs—and dynamic values from previous steps in your Zap.
Click inside the Message Text field. You'll see a dropdown menu of the previous steps in your Zap so far. Click on the upside-down caret next to each step. This will reveal the data that Zapier found when we tested our trigger and search steps.
Then, select the information from your Schedule trigger and PagerDuty search that you'd like to use within your message.
Here's what it looks like when you combine static text and data from our previous Zap steps:
For this example, we want to include the date that the Zap triggered, the user in PagerDuty who's on call, and the email to contact them. You can format your message however you'd like, just make sure it's compatible with your team chat app.
A dynamic value is any data from a previous Zap step that you've mapped to a field in the Zap editor. When you map a dynamic value—such as a contact name—what you see in the editor is a placeholder. Field mapping dynamic values are how you pass data from one app to another. Once your Zap is turned on, Zapier will send the information that the field contains every time your Zap runs.
Next, we'll configure the rest of our message. By default, Zapier will send this message as a bot. That's what we want, so we'll continue setting up the Bot Name and Bot Icon.
Under Include a link to this Zap?, make sure Yes is selected. This makes it easy for you—or anyone else on your team who's on a Zapier Team or Company plan—to make changes to your Zap quickly.
When you're done customizing your message, click Continue.
Finally, it's time to test our Zap. This will send a message in the selected Slack channel. You'll want to test this to make sure your message is formatted correctly.
We recommend having a dedicated team channel for testing Zaps. If you don't have one, just warn your coworkers that you're testing something. Click Test & Review.
You'll see a success message, but let's check Slack to see how everything looks.
If something looks strange with the formatting, you can go back to the previous step, make adjustments, and retest your Zap. Once you're satisfied, you're ready to begin using your Zap.
Create an on-call notification bot from your calendar
Using Zapier with PagerDuty is just one way to create an on-call notification bot. To keep things simple, you can also manage your on-call schedule from the calendar app you're already using.
Google Calendar makes it easy to create multiple calendars for all sorts of things. First, create a new calendar and populate it with upcoming shifts. Then, try our tutorial for sending Google Calendar reminders to Slack. The concept will also apply if you use Microsoft Outlook and Microsoft Teams.
Stay on top of on-call shifts with automation
Don't let those on-call shifts sneak up on you. Automation with Zapier can help you communicate upcoming on-call shifts to your team and company. That way, everyone can breathe easy knowing IT has their back.
New to Zapier? It's a tool that helps anyone connect apps and automate workflows—without any complicated code. Sign up for free.