{"record":{"id":"89ac686d348f7eea","repo":"affaan-m/ECC","slug":"missing-title-for-a-new-work-item","errorCode":null,"errorMessage":"Missing --title for a new work item.","messagePattern":"Missing --title for a new work item\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/work-items.js","lineNumber":325,"sourceCode":"    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,\n    metadata: options.metadataJson !== undefined ? parseMetadataJson(options.metadataJson) : ((existing && existing.metadata) ?? null),\n    createdAt: existing ? existing.createdAt : undefined,\n    updatedAt: new Date().toISOString()\n  };\n}","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/work-items.js#L307-L343","documentation":"A new work item cannot be created without a title: in buildUpsertPayload, options.title is unset and there is no existing item to inherit a title from, so title resolves falsy.","triggerScenarios":"Thrown at scripts/work-items.js:325 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add --title \"<your title>\" to the command","If updating an existing item, verify the id exists so its stored title can be reused"],"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"}