Status Update
Comments
bl...@google.com <bl...@google.com> #2
iv...@snowflake.com <iv...@snowflake.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.
ep...@gmail.com <ep...@gmail.com> #4
Confirming the removal of outOfOfficeProperties (via delete event.outOfOfficeProperties
) does fix the problem. Thanks!
wi...@unity3d.com <wi...@unity3d.com> #5
EDIT: Adding "event.outOfOfficeProperties = [];" to null it out ended up fixing the problem though
jp...@google.com <jp...@google.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.
lw...@gmail.com <lw...@gmail.com> #7
Hope they issue a full solution soon.
Bo...@debtbook.com <Bo...@debtbook.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());
}
}
lw...@gmail.com <lw...@gmail.com> #9
hu...@platoyo.com <hu...@platoyo.com> #10
I can confirm, I also had to set
event.eventType = 'default';
to make it work again.
lw...@gmail.com <lw...@gmail.com> #11
ma...@lightforge.gg <ma...@lightforge.gg> #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();
}
eu...@ansiblehealth.com <eu...@ansiblehealth.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';
lw...@gmail.com <lw...@gmail.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) {
ta...@loyalhealth.com <ta...@loyalhealth.com> #15
Can confirm that the following worked for me prior to importing events on the shared calendar:
delete event.outOfOfficeProperties;
event.eventType = 'default';
su...@dutchie.com <su...@dutchie.com> #16
mi...@officepracticum.com <mi...@officepracticum.com> #17
delete event.outOfOfficeProperties;
event.eventType = 'default';
to the start of
function importEvent(username, event)
fixed the issue.
po...@shoplogix.com <po...@shoplogix.com> #18
jp...@google.com <jp...@google.com> #19
The sample script at
lw...@gmail.com <lw...@gmail.com> #20
Thanks!!! And as an added bonus, since this got you to finally copy/paste
Maybe you should consider always syncing the official version to GitHub? In this case it could have solved this bug almost 2 months ago.
jo...@flexport.com <jo...@flexport.com> #21
Does anyone have any other idea why? I only added the team calendar ID, group email, and added some keywords. Everything else is left untouched and there were no more events synced.
lw...@gmail.com <lw...@gmail.com> #22
To answer your question, I can just quote myself from above:
Why on Earth is there try/catch instead of sending error alerts (when run via triggers) like a normal script...?
That's why you'll never get any errors. This goes against the whole principle of Triggers. I suggest remove the try/catch and then you'll finally get errors and maybe know what was wrong.
P.S. Did you also add the service as explained in "Create the Apps Script project"?
jp...@google.com <jp...@google.com> #23
I am marking this issue as FIXED
as the internally reported issue has been marked as FIXED
. Please note that there may be a delay in rolling this out to production. Thank you for your patience and please comment here if the issue remains.
jp...@google.com <jp...@google.com> #24
This was prematurely closed via an automation as one of the blocking issues was resolved. I set this as blocked by some other work that is underway at the API level to fix this.
jp...@google.com <jp...@google.com> #25
I am marking this issue as FIXED
as the internally reported issue has been marked as FIXED
. Please note that there may be a delay in rolling this out to production. Thank you for your patience and please comment here if the issue remains.
Description
Description
The Vacation Calendar script published by Google has stopped working. It has been working without any issues for 1 year, but since 29 November attempts to import events using the Calendar.Events.import() API fail with a "bad request" and no further explanation.
Code
The part of the script which fails is specifically:
All events fail to import with the same error, unconditionally. Here is one example event:
Output
Steps