{"record":{"id":"ae763049e8f8160b","repo":"eyaltoledano/claude-task-master","slug":"no-tasks","errorCode":"NO_TASKS","errorMessage":"No tasks match the specified criteria","messagePattern":"No tasks match the specified criteria","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/tm-core/src/modules/integration/services/export.service.ts","lineNumber":446,"sourceCode":"\t\tconst allTasks = await fileStorage.loadTasks(tag);\n\n\t\tconst taskListResult = {\n\t\t\ttasks: filteredTasks,\n\t\t\ttotal: allTasks.length,\n\t\t\tfiltered: filteredTasks.length,\n\t\t\ttag,\n\t\t\tstorageType: 'file' as const\n\t\t};\n\n\t\tif (taskListResult.tasks.length === 0) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\ttaskCount: 0,\n\t\t\t\tbriefId,\n\t\t\t\torgId,\n\t\t\t\tmessage: 'No tasks found to export',\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'NO_TASKS',\n\t\t\t\t\tmessage: 'No tasks match the specified criteria'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\ttry {\n\t\t\t// Call the export API with the original tasks\n\t\t\t// performExport will handle the transformation based on the method used\n\t\t\tawait this.performExport(orgId, briefId, taskListResult.tasks);\n\n\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\ttaskCount: taskListResult.tasks.length,\n\t\t\t\tbriefId,\n\t\t\t\torgId,\n\t\t\t\tmessage: `Successfully exported ${taskListResult.tasks.length} task(s) to brief`\n\t\t\t};\n\t\t} catch (error) {","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/integration/services/export.service.ts#L428-L464","documentation":"ExportService.exportTasks returns a non-throwing failure result with code NO_TASKS when, after applying the caller's filters (status, excludeSubtasks) to the local task file for the resolved tag, zero tasks remain. The library treats an empty export set as a soft failure rather than an exception, since exporting zero tasks is almost never intended. It means the brief exists and auth is fine, but the local task list produced nothing to send.","triggerScenarios":"Calling exportTasks({orgId, briefId}) when the tasks file for the active/selected tag is empty, or when options.status (e.g. 'done') matches no tasks, or when excludeSubtasks is true and the tag only contains subtasks.","commonSituations":"Developers hit this when working in a fresh repo where .taskmaster/tasks.json has no tasks yet, when they set --status to a status string that doesn't exactly match stored statuses ('pending' vs 'todo'), when the active tag differs from the tag they populated, or when all tasks were already deleted.","solutions":["Run `tm list` (or check .taskmaster/tasks/tasks.json) to confirm tasks exist under the active tag before exporting.","Remove or widen the status filter in ExportTasksOptions, or pass the correct options.tag matching the populated tag.","Set the active tag with `tm tags --set <tag>` (or pass tag explicitly) to the tag that actually contains tasks.","Create tasks first (tm parse-prd or tm add-task) and retry the export."],"exampleFix":"// before\nawait exportService.exportTasks({ orgId, briefId, status: 'done' });\n// after\nconst tasks = await tmCore.tasks.list();\nif (tasks.length === 0) throw new Error('Create tasks before exporting');\nawait exportService.exportTasks({ orgId, briefId });","handlingStrategy":"validation","validationCode":"const tasks = await tmCore.tasks.list(tag);\nconst exportable = tasks.filter(t => !status || t.status === status);\nif (exportable.length === 0) throw new Error(`No tasks to export for tag '${tag}'`);","typeGuard":"function hasTasks(r: ExportResult): r is ExportResult & { success: true; taskCount: number } {\n  return r.success === true && r.taskCount > 0;\n}","tryCatchPattern":"const result = await exportService.exportTasks(opts);\nif (!result.success && result.error?.code === 'NO_TASKS') {\n  console.warn('Nothing to export - check tag/status filters');\n}","preventionTips":["Run `tm list` before every export to confirm non-empty task set","Avoid hardcoding status filters; derive them from actual task statuses","Always pass the tag explicitly instead of relying on the active tag"],"tags":["export","empty-result","filters","tasks"],"backgroundTag":"empty-result-set","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}