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

Method uncompleteTask

src/api/TaskNotesAPI.ts:2070–2086  ·  view source on GitHub ↗
(
		path: string,
		options?: UncompleteTaskOptions,
		context?: TaskNotesMutationContext
	)

Source from the content-addressed store, hash-verified

2068 }
2069
2070 async uncompleteTask(
2071 path: string,
2072 options?: UncompleteTaskOptions,
2073 context?: TaskNotesMutationContext
2074 ): Promise<TaskInfo> {
2075 const task = await this.requireTask(path);
2076 const targetStatus = options?.status ?? this.plugin.settings.defaultTaskStatus ?? "open";
2077
2078 if (!this.plugin.statusManager.isCompletedStatus(task.status) && !options?.status) {
2079 return copyTaskInfo(task);
2080 }
2081
2082 const updatedTask = await this.withMutationContext([task.path], context, () =>
2083 this.plugin.taskService.updateProperty(task, "status", targetStatus)
2084 );
2085 return copyTaskInfo(updatedTask);
2086 }
2087
2088 async startTimeEntry(path: string, context?: TaskNotesMutationContext): Promise<void> {
2089 await this.startTime(path, undefined, context);

Callers 1

TaskNotesAPIClass · 0.95

Calls 5

requireTaskMethod · 0.95
withMutationContextMethod · 0.95
copyTaskInfoFunction · 0.85
updatePropertyMethod · 0.80
isCompletedStatusMethod · 0.65

Tested by

no test coverage detected