Skip to content

Commit 990da91

Browse files
committed
fix(asana): omit completed unless explicitly set (don't send false on unchecked)
The new completion checkbox mapped an unchecked/untouched state to completed:false, which made update_task silently un-complete tasks and search_tasks filter to incomplete. Now only sends completed when the box is checked (undefined otherwise).
1 parent 105d966 commit 990da91

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

apps/sim/blocks/blocks/asana.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,15 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
442442
.filter((p: string) => p.length > 0)
443443
: undefined
444444

445+
// Only send a completion value when the user actually checked the box; an
446+
// empty/untouched checkbox must omit the field (not send `false`), so
447+
// update_task doesn't silently un-complete a task and search_tasks doesn't
448+
// implicitly filter to incomplete tasks.
449+
const completedValue =
450+
Array.isArray(params.completed) && params.completed.length > 0
451+
? params.completed.includes('completed')
452+
: undefined
453+
445454
const baseParams = {
446455
accessToken: oauthCredential?.accessToken,
447456
}
@@ -471,7 +480,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
471480
name: params.name,
472481
notes: params.notes,
473482
assignee: params.assignee,
474-
completed: params.completed?.includes('completed'),
483+
completed: completedValue,
475484
due_on: params.due_on,
476485
}
477486
case 'get_projects':
@@ -486,7 +495,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
486495
text: params.searchText,
487496
assignee: params.assignee,
488497
projects: projectsArray,
489-
completed: params.completed?.includes('completed'),
498+
completed: completedValue,
490499
}
491500
case 'add_comment':
492501
return {

0 commit comments

Comments
 (0)