Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Tasks are not returned #379

Open
youyeg opened this issue Jan 27, 2023 · 0 comments
Open

Completed Tasks are not returned #379

youyeg opened this issue Jan 27, 2023 · 0 comments
Assignees

Comments

@youyeg
Copy link

youyeg commented Jan 27, 2023

Summary

function listTasks(taskListId) {
  try {
    // List the task items of specified tasklist using taskList id.
    const tasks = Tasks.Tasks.list(taskListId);
    // Tasks.Tasks.list({tasklist: tasklistId, showCompleted: true, completedMin: '1970-01-01T00:00:00Z'});
    // If tasks are available then print all task of given tasklists.
    if (!tasks.items) {
      console.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];
      console.log('Task with title "%s" and ID "%s" was found.', task.title, task.id);
    }
  } catch (err) {
    // TODO (developer) - Handle exception from Task API
    console.log('Failed with an error %s', err.message);
  }
}

Expected Behavior

Logging all the tasks

Actual Behavior

It only returns the uncompleted tasks. I want to return all the tasks of a list.

Steps to Reproduce the Problem

Just run it in Google Apps Scripts with the list ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants