2

Recently Google Workspace released the possibility to assign tasks to people in Google Docs. Those tasks appear then in the Google Task app, however, when queried via API (or even Zappier) they don't show up.

Anyone has tried it? I want to pull them via API to forward them to my things3 inbox

Code:

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);
  }

thanks

Álvaro
  • 21
  • 2

1 Answers1

2

This is a known issue with the Google Tasks API, as reported on Google's Issue tracker:

zr0gravity7
  • 2,917
  • 1
  • 12
  • 33