diff --git a/solutions/automations/vacation-calendar/Code.js b/solutions/automations/vacation-calendar/Code.js index d00a2bee6..ef0078a20 100644 --- a/solutions/automations/vacation-calendar/Code.js +++ b/solutions/automations/vacation-calendar/Code.js @@ -97,6 +97,15 @@ function importEvent(username, event) { id: TEAM_CALENDAR_ID, }; event.attendees = []; + + // If the event is not of type 'default', it can't be imported, so it needs + // to be changed. + if (event.eventType != 'default') { + event.eventType = 'default'; + delete event.outOfOfficeProperties; + delete event.focusTimeProperties; + } + console.log('Importing: %s', event.summary); try { Calendar.Events.import(event, TEAM_CALENDAR_ID);