Fix task creation to use sprint's project when sprint is selected

This commit is contained in:
OpenClaw Bot 2026-02-19 19:49:26 -06:00
parent 5bcb1a6468
commit b737a1c318
2 changed files with 7 additions and 3 deletions

View File

@ -482,7 +482,7 @@
]
}
],
"lastUpdated": 1771551794092,
"lastUpdated": 1771552039142,
"sprints": [
{
"name": "Sprint 1",

View File

@ -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)