Search for Stalled Projects

Does anyone know how to write a search for projects with no remaining tasks that are not done? Thank you.

Have you tried something like:

//@type=project except //not @done/ancestor::*

Thanks, that works well, but doesn’t include projects with all tasks done that have notes…

One itempath shortcut is to elide @type=, and just use project or task or note on their own.

A related itempath shortcut is to assume that “and” is the default conjunction, and skip that too, so the next thing to try might be something like:

//project except //task not @done/ancestor::*

Right…I was asking something else as I’m still trying to get familiar with the Xpath syntax.

If I have a project like this:

Project:

  • Task 1 @done
    Note for Task 1
  • Task 2 @done

Your search does not pick it up because the note isn’t tagged with @done. I was trying to figure out how to exclude notes from the qualification but couldn’t get it to work.

Thank you, by the way.

Are your task notes indented under their parent tasks, or at the same level of indent ?

A TaskPaper file is a tab-indented outline, so:

  • a note tab-indented under a task is attached as a child of that task, but
  • a note which simply follows a task is just an unattached peer of it (doesn’t belong to it), and won’t be found by itempath searches in the way you expect.

If you tab-indent your notes to attach them to tasks as children, then I think you may find that the itempath above does what you want.


Project:
    - Task 1 @done
        Note for Task 1
    - Task 2 @done
1 Like

The itempath you suggested shows neither my projects with notes yet no remaining undone tasks (and my notes are indented under tasks, except project notes in some cases which come before the first task), nor your sample project above.

I wonder where the divergence is. With a TaskPaper document like this,

clicking the Stalled search, where stalled is defined by

//project except //task not @done/ancestor::*

is showing me the following:

2 Likes

PS I assume that your tasks are indented under projects ?

( rather than succeeding them, as peers, at the same level of indentation )

Yes, and my search had a typo. It works now. Again, many thanks.

1 Like