affaan-m/ECC · error · Error
Missing work item id. Pass
Error message
Missing work item id. Pass <id> or --id <id>.
What it means
buildUpsertPayload in work-items.js needs a work item identifier for an upsert; resolveWorkItemId returned null because neither a positional <id> nor --id was supplied.
Solutions
- Pass the work item id positionally: node scripts/work-items.js item add 123 ...
- Or pass it explicitly with --id 123
- Run item list first to find the id of an existing work item
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at scripts/work-items.js:320 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/1266826417872301.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/work-items.js:320
);
}
const closedItems = closeStaleGithubItems(store, repo, activeIds, { limit: Math.max(limit * 4, 1000) });
return {
repo,
syncedAt,
prCount: prs.length,
issueCount: issues.length,
closedCount: closedItems.length,
items,
closedItems
};
}
function buildUpsertPayload(options, existing = null) {
const id = resolveWorkItemId(options);
if (!id) {
throw new Error('Missing work item id. Pass <id> or --id <id>.');
}
const title = options.title ?? (existing && existing.title);
if (!title) {
throw new Error('Missing --title for a new work item.');
}
return {
id,
source: options.source ?? (existing && existing.source) ?? 'manual',
sourceId: options.sourceId ?? (existing && existing.sourceId) ?? null,
title,
status: options.status ?? (existing && existing.status) ?? 'open',
priority: options.priority ?? (existing && existing.priority) ?? null,
url: options.url ?? (existing && existing.url) ?? null,
owner: options.owner ?? (existing && existing.owner) ?? null,
repoRoot: options.repoRoot ?? (existing && existing.repoRoot) ?? process.cwd(),
sessionId: options.sessionId ?? (existing && existing.sessionId) ?? null,View on GitHub (pinned to 8321021c54)