Hello, in another old post, I found a query to have a task page with a list of tasks and sub-tasks.
#+BEGIN_QUERY
{:query [:find (pull ?b [*])
:in $ %
:where
[?b :block/marker ?marker]
[(contains? #{"TODO"} ?marker)]
;; ancestor is true when ?ancestor is an ancestor of b
(not (ancestor ?b ?ancestor)
[?ancestor :block/marker ?amarker]
[(contains? #{"TODO" "NOW" "DOING"} ?amarker)])]
:inputs
[[[[ancestor ?b ?ancestor]
[?b :block/parent ?ancestor]]
[[ancestor ?b ?ancestor]
[?child :block/parent ?ancestor]
(ancestor ?b ?child)]]]
:result-transform (fn [result]
(sort-by (fn [b]
(get b :block/priority "Z")) result))
:breadcrumb-show? false
}
#+END_QUERY
I have a problem: I would like only the child blocks that are TODO to appear because currently, both TODO blocks and their non-TODO children appear, and I only want the sub-tasks.
Thank you very much