{"record":{"id":"1266826417872301","repo":"affaan-m/ECC","slug":"missing-work-item-id-pass-id-or-id-id","errorCode":null,"errorMessage":"Missing work item id. Pass <id> or --id <id>.","messagePattern":"Missing work item id\\. Pass <id> or --id <id>\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/work-items.js","lineNumber":320,"sourceCode":"    );\n  }\n\n  const closedItems = closeStaleGithubItems(store, repo, activeIds, { limit: Math.max(limit * 4, 1000) });\n  return {\n    repo,\n    syncedAt,\n    prCount: prs.length,\n    issueCount: issues.length,\n    closedCount: closedItems.length,\n    items,\n    closedItems\n  };\n}\n\nfunction buildUpsertPayload(options, existing = null) {\n  const id = resolveWorkItemId(options);\n  if (!id) {\n    throw new Error('Missing work item id. Pass <id> or --id <id>.');\n  }\n\n  const title = options.title ?? (existing && existing.title);\n  if (!title) {\n    throw new Error('Missing --title for a new work item.');\n  }\n\n  return {\n    id,\n    source: options.source ?? (existing && existing.source) ?? 'manual',\n    sourceId: options.sourceId ?? (existing && existing.sourceId) ?? null,\n    title,\n    status: options.status ?? (existing && existing.status) ?? 'open',\n    priority: options.priority ?? (existing && existing.priority) ?? null,\n    url: options.url ?? (existing && existing.url) ?? null,\n    owner: options.owner ?? (existing && existing.owner) ?? null,\n    repoRoot: options.repoRoot ?? (existing && existing.repoRoot) ?? process.cwd(),\n    sessionId: options.sessionId ?? (existing && existing.sessionId) ?? null,","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/work-items.js#L302-L338","documentation":"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.","triggerScenarios":"Thrown at scripts/work-items.js:320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}