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
This is a known issue with the Google Tasks API, as reported on Google's Issue tracker:
Update (2025): Tasks assigned via Google Docs now show up in the Tasks API. Just add showAssigned to your request:
const tasks = Tasks.Tasks.list(taskListId, {
  showAssigned: true
});
This includes tasks created with @Assign task in Google Docs, which were previously hidden.
Reference: Tasks API – tasks.list parameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With