Google Calendar integration via Zapier

This article shows how to integrate Google Calendar with Out of Office Assistant for Jira in two steps:

  1. Activate rules in Out of Office Assistant with new Google Calendar events 
  2. Deactivate existing rules in Out of Office when Google Calendar events are canceled

Google Calendar business accounts include the ability to create Out of Office events, which can be used to activate absences in Out of Office Assistant for Jira. Please note that Zapier has a known issue loading a required variable for this setup, but you can circumvent the issue by using the template offered below.

If you don't have a Google Calendar business account, however, you can create a custom filter in the configuration of the Zapier action for Out of Office Assistant.

Create a Zap connecting Google Calendar to Out of Office Assistant for Jira

  • Once you have logged into zapier.com, click on the Create Zap button located at the top of the side panel.

  • Next, select Google Calendar as Trigger in the workflow builder

The following steps depend on whether you want to create new absences or delete existing absences, as specified in the next paragraphs.

Activate rules in Out of Office Assistant with new Google Calendar events 

In order to activate absences in Jira from Google Calendar, select New Event in the Event field. Then, click on Continue.

Configure Google Calendar as a trigger

  • Follow the instructions to connect to your Google Calendar account. You can use an already existing connection, or create a new one.

  • Once the connection succeeds, click on Continue
  • In the next step, select the Calendar where the Out of Office events will be created. Then, click on Continue.

  • Go ahead and Test the Trigger. Make sure that at least one event exists in your calendar. You don't need an existing Out of Office event yet, as this will only check that Zapier is able to retrieve data from your Google Calendar.

Configure Out of Office Assistant as an Action

  • Once the test succeeds, you will be prompted to select your Action. Simply type "Jira" to find Out of Office Assistant for Jira.

  • Select the Add or Update Absence event and click on Continue 

  • Use a connected account or follow the steps described in this article to authorize a new connection.

If you create a new token for authorizing the zap, it's a good idea to copy it and keep it for later. You will need it if you create an additional Zap to remove absences when Google Calendar events are canceled.


Now you're ready to start defining the rule and mapping attributes between both sides.

Defining the rule and mapping it to Google Calendar

Remember that every time the zap is triggered from Google Calendar, a rule will be activated in Out of Office. The rules will vary depending on how you map the attributes:

  • When a field in the Out of Office action is mapped to Google Calendar, it will change with every Google Calendar event. For example, the Start Date.
  • When a field in the Out of Office action is not mapped to Google Calendar but defined as a constant, it will be the same every time the rule is activated. For example, the person that will cover for your issues. Fields that refer to specific Jira functionality usually can't be mapped.
  • Start Date (Mandatory). Map it to the Event Begins field.

  •  End Date (Mandatory). Map it to the Event Ends field.

  • Message (Optional). The Out of Office message doesn't have to be mapped. You can use a standard like "I'm Out of Office". You can also include variables from the event, like in the example below.

 

  • The Event Filter (Optional) and Event Filter Description (Optional)can be used to filter out events that don't correspond to time off. Please refer to the next section of this guide to set them up correctly.

The following fields have to be set manually, as they refer to specific features in Jira:

  • Project for which the rules apply (Mandatory)
  • Coverers for automatic reassigns (Optional)
  • Coverer for approver reassigns (Optional). Pick one or more users from the list.
  • Custom field of approvers (Optional). By default, this option is set to "Approvers". You can manually pick a different one.
  • Do not share comments with customers.(Sharing is enabled by default)
  • Mention Type (Optional)
  • Mention Label (Optional)


Setting up a filter

Filtering the events that will create absences in Jira is really important, since you don't want standard meeting appointments to trigger the automation.

Using a business account

Please note that a business account of Google Calendar is needed in order to create Out of Office responses. In that case, please use the following mapping:

  • Event Type: Select the Google Calendar field "Event Type". 
  • Filter Description: The filter description "outOfOffice".

Use this template to force the Event Type field from Google Calendar

There is a known issue in Zapier whereby the Google Calendar Event Type variable doesn't appear in the dropdown and can't be mapped. If you encounter this issue, don't worry! You have three alternatives:

  • Use the template below. Once the template loads, the Event Type variable should already be mapped, and you will be able to override any settings and match your desired configuration.
  • Insert a custom pill, as described in this section, right below the template.
  • Alternatively, you can build a custom filter as described in the section "Using a free account".
Creating a custom pill to force the Event Type variable

Custom pills allow you to force Zaps to pull the value from a specific field in a specific step. To create a custom pill, you need 2 things:

  1. The ID of the step returning the data. Each time you expand an action, the URL will dynamically update to reflect that step ID. The step ID is displayed at the end of the URL:
  2. The exact name of the field you want to pull data from. In this case, "eventType".

Given that sample URL, the custom pill would be:

{{168336672__eventType}}
CODE

Once you have the custom pill, simply paste it into the 

Using a free account

In absence of a business account, it's still possible to create a custom filter as with any other app. In this case, build the mapping that best fits your use case. For example:

  • Event Type: Select the field where the filtering term will be, in this case, the Summary
  • Filter Description: Use whichever convention suits you. Something like the abbreviation OoO should not trigger false events.


Deactivate existing rules in Out of Office when Google Calendar events are canceled

An additional Zap is needed in order to remove an absence when a Google Calendar is canceled before its end date.

Configure Google Calendar as a trigger

Follow the same process to create a zap and select Google Calendar as a trigger, as instructed in the section above (Activate rules in Out of Office Assistant with new Google Calendar events).

  • In the event selection, pick Event Cancelled

 

  • Select the same connection as in the zap for adding absences
  • Pick the same Calendar as in the zap for adding absences

Configure Out of Office Assistant as an action

  • In the Action, select Out of Office Assistant for Jira
  • Next, select the event Delete Absence

  • Select the same connection as in the zap for adding absences.
  • If you are asked to authenticate, make sure to use the same token that was passed for the event creation.

The token management in Out of Office currently only supports one token per user. Make sure to store your token if you want to reuse it for multiple connections, including multiple zaps.


Mapping the canceled event to existing absences

  • Start date (Mandatory). Map the Start Date to the Event Begins variable

  • End date (Mandatory). Map the End Date to the Event Ends variable

  • The project for which the rules apply (Mandatory). Make sure to make the same manual selection as in the activation zap.
  • Event Type (Optional). Match this field to the setup of the Add Absence action.
  • Event Filter Description (Optional). Match this field to the setup of the Add Absence action.


If you need to map the Google Calendar variable Event Type in the Event Type field, please follow the instructions to insert a custom pill in the section above (Use this template to force the Event Type field from Google Calendar), as there is a known issue preventing the field from displaying in the dropdown. 

An absence deletion template has been submitted to Zapier for validation at the time of writing this section (January 4th, 2022) and will take a couple of weeks to show below these lines.