The Calendar app allows advanced creating, updating & deleting of calendar events via a Webhook which the app can create for you.
A webhook named App - Calendar - Event create or update is created once the create webhook button is clicked under the Settings menu item in the app. Once installed, you can then proceed to create trigger actions to setup advanced timer workflows.
The webhook accepts the following parameters:
Parameter | Value |
calendar_id* | The ID of the calendar this event should be created in. Find the ID of a calendar by opening the calendar in the admin view and finding the "ID: ..." section at the bottom of the page. |
start_date* | The value of a ticket field of type "Date". |
start_time* | The value of a ticket field of type "Text". This field accepts many ways to express time, such as "1pm", "13:00", "1:00 PM". Required if is_all_day is not "true". |
timezone* | An IANA timezone value such as "Australia/Melbourne" or "America/Los_Angeles". |
identifier | Used to identify the calendar event on the ticket. If the webhook is called with an event that already exists with this identifier, it will be updated, otherwise a new one will be created. Required to delete events. |
end_date** | The value of a ticket field of type "Date". |
end_time** | The value of a ticket field of type "Text". This field accepts many ways to express time, such as "1pm", "13:00", "1:00 PM". |
duration_in_minutes** | A number value that can be specified instead of end_date and end_time. |
is_all_day | "true" if this concerns an all-day event. All-day events ignore the parameters start_time and end_time. |
subject | Any text value. |
description | Any text value. |
location | Any text value. |
attendees | A list of email addresses of people that should be invited on the event. |
*Mandatory field when creating a new event
**An end date and time must be provided unless 'duration_in_minutes' or 'is_all_day' is used.
Your calendar ID can be found at the bottom of the page of the particular calendar in the admin view in the app.
Create a new calendar event
Below is an example of how the webhook can be used. In the example below, the following ticket fields have already been created:
Pass these values into the webhook using a trigger action:
Please ensure to set an identifier if you calendar events need to be deleted at a later stage.
All day event example
If the event you are creating is an all day event, then the start time and end or duration times are not required, but the 'is_all_day' parameter is used instead. This example also uses the Due Date Zendesk field:
Delete a calendar event
Deleting a calendar event requires a unique calendar identifier to be set on creation, so it is important this is supplied on your create webhook above.
To delete the event, create a new trigger to fire with the 3 following parameters on the same webhook:
- calendar_id
- identifier - this must match the ID supplied when the event was created.
- start_date - this must be empty which tells us to remove the event.