Within my daily notes, I use #log/sprint to capture info relating to various projects and parts. For example, on 7/23/2025 I might log:
[u] #log/sprint on #project/ExampleProject/part
- Released Revision A of [[pn 11111]] to production
- Update description of [[pn 22222]]
- Update title of [[pn 333333]]
Then, on my [[pn 11111]], [[pn 22222]], or [[pn 33333]] note pages, I see every task I’ve ever logged that links to that specific page. These pages are then tagged in frontmatter with #project/ExampleProject/part indicating they are parts that belong to ExampleProject
TASK
WHERE icontains(text, this.file.name)
Easy, no issues so far.
On my [[ExampleProject]] page, I see all sprints that have been tagged with #project/ExampleProject. Again, no issue here.
TASK
WHERE icontains(text, "#log/sprint")
AND (icontains(text, this.file.name) OR icontains(text, "#project/ExampleProject") )
However, I’d like a page in which I see all the incomplete tasks to any page with #project/ExampleProject/part in the frontmatter. Expected results would be:
###Example Project Part Issue Tracking
Incomplete tasks of parts with #project/ExampleProject/part in frontmatter
pn 22222
- Update description of [[pn 22222]]
pn33333
- Update title of [[pn 333333]]
Things I have tried
Various google searched, combination of WHERE + FROM queries.
claremacrae’s solution posted nov 23, 2022
“Possible to query tasks only from files with certain tags [in frontmatter]? #442”
I’m trying my best to understand the dataviewJS component, but its my first foray into JS.
```dataviewjs
const tag = '#project/ExampleProject/part'
const matching_files = dv.pagePaths(tag)
if ( matching_files.length > 0 ) {
const query = `
not done
(path includes ${matching_files.join(') OR (path includes ')})
# you can add any number of extra Tasks instructions, for example:
group by path
`;
dv.paragraph('```tasks\n' + query + '\n```');
} else {
const message = `No files found with tag ${tag}`
dv.paragraph(message)
}
I’m seeing 2 issues with this solution:
This returns incorrect tasks from the following daily note. Even though I’m querying #project/ExampleProject/part, its also returning the task under #project/OtherProject because its in the same daily note file.
- [u] #log/sprint on #project/ExampleProject/part
- [x] Send 3x ECOs out for digital review today
- [ ] Must clean up [[00011]].
- [u] #log/sprint on #project/OtherProject
- [ ] Need ECO for [[Apollo]] artwork update on battery pack
The results are grouped by note path when I’d like them grouped by linked mention.
Now the only edge case remaining is that notes are seperated by their file name and alias, when I’d like them combined into 1 header. Do you know have any solution?
TASK
WHERE !completed AND contains(outlinks.file.tags, "project/ExampleProject/part")
FLATTEN outlinks
GROUP BY string(outlinks)
SORT filename DESC
I think you’re saying that when one task item has [[pn 11111|alias1]] and another has [[pn 11111]] or a different display name, you get separate groups for the same note. Let me know if you meant something else.
Does removing the string transformation from GROUP BY fix that?
```dataview
TASK
WHERE !completed AND contains(outlinks.file.tags, "project/ExampleProject/part")
FLATTEN outlinks
GROUP BY outlinks
SORT filename DESC
```