I know it is possible to create a trigger:
function testTriggers()
{
var now = new Date();
now.setMinutes(now.getMinutes() 1);
ScriptApp.newTrigger("bingo").timeBased().at(now).create();
}
And once the trigger runs, it will be marked as Disabled
.
I know you can get all triggers:
ScriptApp.getProjectTriggers()
But I can't find a way to identify which triggers are disabled so I can delete just those triggers.
I need to find the disabled triggers so I can then create more triggers.
CodePudding user response:
Currently, there isn't a way to identify disabled triggers. This feature is requested by OP:
Kindly add a star to the issue, if you want Google developers to implement this request.
Possible workarounds:
- Delete the trigger when the function is triggered
- Save the trigger id as a
key
in properties, when the trigger is created. When the trigger function is triggered, add a disabled marker asvalue
to the triggeridkey
in properties. Then you may deleted all disabled triggers later. - Manually delete all disabled triggers from the dashboard.