【发布时间】:2022-10-21 12:31:59
【问题描述】:
最近Google Workspace released 可以将任务分配给 Google 文档中的人员。这些任务随后会出现在 Google Task 应用程序中,但是,当通过 API(甚至 Zappier)查询时,它们不会出现。
有人试过吗?我想通过 API 提取它们以将它们转发到我的 things3 收件箱
代码:
function listTasks(taskListId) {
try {
// List the task items of specified tasklist using taskList id.
Tasks.Tasks.list(taskListId,{state:"1"})
const tasks = Tasks.Tasks.list(taskListId);
// If tasks are available then print all task of given tasklists.
if (!tasks.items) {
Logger.log('No tasks found.');
return;
}
// Print the task title and task id of specified tasklist.
for (let i = 0; i < tasks.items.length; i++) {
const task = tasks.items[i];
if (task.status != "completed"){
Logger.log(task.title)
//Logger.log('Task with title "%s" and ID "%s" was found and status %s.', task.title, task.id, task.completed);
}
}
} catch (err) {
// TODO (developer) - Handle exception from Task API
Logger.log('Failed with an error %s', err.message);
}
谢谢
【问题讨论】:
标签: google-tasks-api google-tasks