alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
104 stars 9 forks source link

Don't process parent tickets #652

Closed alanvardy closed 8 months ago

alanvardy commented 8 months ago

Process tickets without children, and child tickets, but not parent tickets.

See if there is a way to identify parent tickets where all child tickets ARE complete. We could complete those.

stacksjb commented 8 months ago

You can label subtasks, but not reassign them to another project as then they would then not be a subtask anymore.

So child tasks should be ignored for "empty" but not for "label", "prioritize", or "schedule".

Parent tasks could be processed depending on the workflow.

Mapping child to parents is easy (presence of parent_id), however unfortunately mapping parent to child is not so straightforward. The practical/best way for it to be done would be if you map the whole task list and dedup the database. Could you remove tasks where the task "id" is present as a "parent_id" before outputting? (iterate over parent_ids present / not null, and remove the parent task(s)?)

This could get interesting as theoretically you can have an unlimited number of layers deep, but I would think that would result in a set of tasks where you only have the lowest child returned.

Related #615

stacksjb commented 8 months ago

Based on the way the API should work, it should not be returning completed tasks (for some reason it is - working with Todoist team and will let you know what we find out).

alanvardy commented 8 months ago

By playing around with it, I discovered that child tasks use the checked field to indicate that they are completed but can be reset when the parent task is completed.

So I am now making sure that parent tasks don't have any unchecked child tasks before completing, and that unchecked child tasks don't have parent tasks in the future.

alanvardy commented 8 months ago

Done