Status Update
Comments
gi...@block.xyz <gi...@block.xyz> #2
ro...@kognitivinc.com <ro...@kognitivinc.com> #3
I have identified the problematic property:
"outOfOfficeProperties": {
"autoDeclineMode": "declineAllConflictingInvitations",
"declineMessage": "Out sick, but available for important or urgent matter "
}
Import works again after removing it.
ma...@gmail.com <ma...@gmail.com> #4
Confirming the removal of outOfOfficeProperties (via delete event.outOfOfficeProperties
) does fix the problem. Thanks!
jo...@gmail.com <jo...@gmail.com> #5
EDIT: Adding "event.outOfOfficeProperties = [];" to null it out ended up fixing the problem though
yu...@expensify.com <yu...@expensify.com> #6
I have forwarded this to the engineering team. Another request failing with 400 but not having the outOfOfficeProperties
field would be helpful. Thank you.
jo...@oikos-international.org <jo...@oikos-international.org> #7
Hope they issue a full solution soon.
jo...@google.com <jo...@google.com> #8
Our script also broke for syncing individual time off to a shared team calendar. In my case I had to delete the outOfOfficeProperties
attribute and also change the eventType to default
as the outOfOffice
eventType is not supported in shared calendars.
function importEvent(username, event) {
event.summary = '[' + username + '] ' + event.summary;
event.organizer = {
id: TEAM_CALENDAR_ID,
};
event.attendees = [];
// remove outOfOfficeProperties to support importing outOfOffice events
// see https://issuetracker.google.com/issues/313935022?pli=1
delete(event.outOfOfficeProperties);
// switch event type to default, cannot create `outOfOffice` events in shared calendars
event.eventType = 'default';
console.log('Importing: %s', event.summary);
try {
Calendar.Events.import(event, TEAM_CALENDAR_ID);
} catch (e) {
console.error('Error attempting to import event: %s. Skipping.',
e.toString());
}
}
ma...@dynamicscreen.com <ma...@dynamicscreen.com> #9
[Deleted User] <[Deleted User]> #10
[Deleted User] <[Deleted User]> #11
si...@comeen.com <si...@comeen.com> #12
full script below:
/**
* Sets up the script to run automatically every hour.
*/
function setup() {
let triggers = ScriptApp.getProjectTriggers();
if (triggers.length > 0) {
throw new Error('Triggers are already setup.');
}
ScriptApp.newTrigger('sync').timeBased().everyHours(1).create();
// Runs the first sync immediately.
sync();
}
fr...@parkside-interactive.com <fr...@parkside-interactive.com> #13
Confirming that removing outOfOfficeProperties helped for a while, but couple of days later got the same error, have to add event.eventType = 'default';
ga...@comeen.com <ga...@comeen.com> #14
True, looks like the new error started at midday December 15th.
Why on Earth is there try/catch instead of sending error alerts (when run via triggers) like a normal script...?
My solution is therefore a new variable called TEMPORARY_FIX and checking for it inside the relevant function (but note I only do this for eventType outOfOffice):
let TEMPORARY_FIX = true;
...
function importEvent(username, event) {
...
try {commonmark.org
if (typeof TEMPORARY_FIX !== 'undefined' && TEMPORARY_FIX && event.eventType == 'outOfOffice') {
delete event.outOfOfficeProperties;
event.eventType = 'default';
}
Calendar.Events.import(event, TEAM_CALENDAR_ID);
} catch (e) {
yu...@pwc.com <yu...@pwc.com> #15
Can confirm that the following worked for me prior to importing events on the shared calendar:
delete event.outOfOfficeProperties;
event.eventType = 'default';
[Deleted User] <[Deleted User]> #16
ja...@google.com <ja...@google.com> #17
delete event.outOfOfficeProperties;
event.eventType = 'default';
to the start of
function importEvent(username, event)
fixed the issue.
is...@google.com <is...@google.com>
lu...@google.com <lu...@google.com> #18
jp...@google.com <jp...@google.com>
jp...@google.com <jp...@google.com> #19
The sample script at
Description
A short description of the request:
With the new feature that was recently rolled out that allows users to specify if they are working from Office/Home/Multiple Locations, it has really made Google Calendar a lot more useful for a hybrid environment.
Our organization would benefit greatly from being able to both see these locations, as well as change them through the API
What is the purpose of this new feature?
To allow API applications to read from, and update a user's work location. We have a companion app for our organization to help us understand who is in the office and who is working remotely.
What existing APIs would this affect?
Calendar API settings .
What existing data does this use?
The user's configured working location settings.