Has anyone else experienced unusual behavior when trying to obtain a timebased trigger from the ScriptApp class in the V8 Runtime?
When performing the following steps in Rhino and V8, I receive two different outcomes (i.e the timebased trigger is not returned in V8 Runtime). Any ideas?
1. Create a new Google Form
2. Open the Apps Script Editor and paste in the below code
3. Disable the Chrome V8 Runtime
4. Execute the createTriggers function
5. Execute the getTriggers function
6. Observe the logs where 2 triggers are returned from the getUserTriggers method
7. Enable the Chrome V8 Runtime
8. Execute the getTriggers function again
9. Observe the logs where only 1 trigger is returned from the getUserTriggers method (where is the timebased trigger?)
function createTriggers(){
var form = FormApp.getActiveForm();
ScriptApp.newTrigger('timeBased').timeBased().everyHours(1).create();
ScriptApp.newTrigger('formSubmit').forForm(form).onFormSubmit().create();
}
function getTriggers() {
var form = FormApp.getActiveForm();
var triggers = ScriptApp.getUserTriggers(form);
Logger.log('user_triggers:');
Logger.log(triggers);
for (var i = 0; i < triggers.length; i++){
Logger.log('user_trigger ' + (i+1));
Logger.log(triggers[i].getHandlerFunction());
}
}
function formSubmit(){
Logger.log('entering formSubmit function');
}
function timeBased(){
Logger.log('entering timeBased function');
}