Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Tasks assigned from a Google Doc, not showing when queried via API

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

like image 680
Álvaro Avatar asked Oct 28 '25 09:10

Álvaro


2 Answers

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

  • Google Tasks API not compatible with assigned tasks
  • Make Tasks created from a Google Docs available from the Google Tasks API
like image 142
zr0gravity7 Avatar answered Oct 31 '25 07:10

zr0gravity7


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

like image 24
javo Avatar answered Oct 31 '25 07:10

javo