Issue
After creating a script to generate events from specific emails, the script runs without errors but does not display any events on the calendar. I am confident in the code itself and suspect that there may be authentication settings needing configuration to properly create events.
Attempts to Resolve
- Confirmed ability to read events via GAS.
- Extracted desired emails using GAS.
- Verified correct default calendar ID.
Code Snippet and Console Output
See below for the code snippet and console log.
function myFunction() {
var event = CalendarApp.getDefaultCalendar().createEvent(
"test",
new Date("2021", "02", "20", "10", "05"),
new Date("2021", "02", "28", "10", "30"));
console.log('Event ID: ' + event.getTitle() + ' is created');
}
5:52:52 PM Notice Execution started
5:54:17 PM Info Event ID: test is created
5:52:53 PM Notice Execution completed