Hi all,
I have recently just setup my new task system in Obsidian with the following structure:
Individual file per task
Individual file per project
Task files “link” to their respective project like so: project:: [[Clean up the garage]]
Both projects and tasks have statuses. e.g. a project can have the status #ps/current where as the task #as/now
I’d like to create a list of #as/now tasks where their linked project has a status of #ps/current. Is this possible with dql? Or am I needing something a bit more advanced with dataviewjs?
Things I have tried
Honestly, I haven’t gotten too far on my own. I started to put together a WHERE clause, but soon realized that I didn’t have “access” to the project’s status from a task level.
Would be easier if “status” was a field and not a “tag”. For this purpose tags are more difficult to work with, because they are, by default, an array and you can have multiple tags in same file.
But possible. Try this
LIST
FROM #as/now
WHERE contains(project.file.etags, "#ps/current")
FWIW my statuses are also a field. So I have the then setup like this: action-status:: #as/now. How would you go about it differently with a field - maybe it works
I think the previous query works with your tags.
When I said "Would be easier if “status” was a field and not a “tag”, in the case I was talking about the status in the project file, not in task note. (because you need to target the status of the project via the link in the field project:: in task file). But works with project.file.etags.
For example, if you create in project the field status:: done you can target this status through the link in the field project in tasks >>> project.status.