MCPcopy
hub / github.com/callumalpass/tasknotes / getSubtasks

Method getSubtasks

src/api/TaskNotesAPI.ts:1859–1875  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1857 }
1858
1859 async getSubtasks(path: string): Promise<TaskInfo[]> {
1860 const task = await this.requireTask(path);
1861 const allTasks = await this.plugin.cacheManager.getAllTasks();
1862 const subtasks: TaskInfo[] = [];
1863
1864 for (const candidate of allTasks) {
1865 if (candidate.path === task.path) continue;
1866 for (const project of candidate.projects ?? []) {
1867 if (await this.taskReferenceMatches(project, candidate.path, task.path)) {
1868 subtasks.push(candidate);
1869 break;
1870 }
1871 }
1872 }
1873
1874 return uniqueTasks(subtasks).map(copyTaskInfo);
1875 }
1876
1877 async getTaskDependencies(path: string): Promise<ResolvedTaskDependency[]> {
1878 const task = await this.requireTask(path);

Callers 2

TaskNotesAPIClass · 0.95
getTaskRelationshipsMethod · 0.95

Calls 4

requireTaskMethod · 0.95
taskReferenceMatchesMethod · 0.95
uniqueTasksFunction · 0.85
getAllTasksMethod · 0.45

Tested by

no test coverage detected