From b737a1c318498e7761019665961df47c4c0cfeba Mon Sep 17 00:00:00 2001 From: OpenClaw Bot Date: Thu, 19 Feb 2026 19:49:26 -0600 Subject: [PATCH] Fix task creation to use sprint's project when sprint is selected --- data/tasks.json | 2 +- src/app/page.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/tasks.json b/data/tasks.json index 7518f12..7ee7e71 100644 --- a/data/tasks.json +++ b/data/tasks.json @@ -482,7 +482,7 @@ ] } ], - "lastUpdated": 1771551794092, + "lastUpdated": 1771552039142, "sprints": [ { "name": "Sprint 1", diff --git a/src/app/page.tsx b/src/app/page.tsx index 38de193..c3f4ffa 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -123,10 +123,14 @@ export default function Home() { } const handleAddTask = () => { - if (newTask.title?.trim() && selectedProjectId) { + if (newTask.title?.trim()) { + // If a specific sprint is selected, use that sprint's project + const selectedSprint = newTask.sprintId ? sprints.find(s => s.id === newTask.sprintId) : null + const targetProjectId = selectedSprint?.projectId || selectedProjectId || '2' + addTask({ ...newTask, - projectId: selectedProjectId, + projectId: targetProjectId, status: newTask.status || "backlog", sprintId: newTask.sprintId || currentSprint?.id, // Use selected sprint or default to current } as any)