{"record":{"id":"1910817d73428081","repo":"hcengineering/platform","slug":"parent-not-found-issue-clickupparentid-for-ta","errorCode":null,"errorMessage":"Parent not found: ${issue.clickupParentId} (for task: ${clickupId})","messagePattern":"Parent not found: (.+?) \\(for task: (.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/clickup/clickup.ts","lineNumber":163,"sourceCode":"    const importProjectsByName = new Map<string, ImportProject>()\n    for (const projectName of projects) {\n      const identifier = this.getProjectIdentifier(projectName)\n      importProjectsByName.set(projectName, {\n        class: tracker.class.Project,\n        title: projectName,\n        identifier,\n        private: false,\n        autoJoin: false,\n        projectType: importProjectType,\n        docs: []\n      })\n    }\n\n    for (const [clickupId, issue] of importIssuesByClickupId) {\n      if (!this.clickupBlankString(issue.clickupParentId)) {\n        const parent = importIssuesByClickupId.get(issue.clickupParentId as string)\n        if (parent === undefined) {\n          throw new Error(`Parent not found: ${issue.clickupParentId} (for task: ${clickupId})`)\n        }\n        parent.subdocs.push(issue)\n      } else if (!this.clickupBlankString(issue.clickupProjectName)) {\n        const project = importProjectsByName.get(issue.clickupProjectName as string)\n        if (project === undefined) {\n          throw new Error(`Project not found: ${issue.clickupProjectName} (for task: ${clickupId})`)\n        }\n        project.docs.push(issue)\n      } else {\n        throw new Error(`Task cannot be imported: ${clickupId} (No parent)`)\n      }\n    }\n\n    return {\n      projects: Array.from(importProjectsByName.values()),\n      projectType: importProjectType\n    }\n  }","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/clickup/clickup.ts#L145-L181","documentation":"In the importer's ClickUp processing, each issue whose `clickupParentId` is non-blank must reference another issue present in `importIssuesByClickupId`. If the parent id cannot be resolved, `processClickupTasks` throws with both the missing parent id and the dependent task id. The import aborts because the task cannot be attached as a subdoc.","triggerScenarios":"Running an import where an issue's clickupParentId references a task that was not imported into `importIssuesByClickupId` — e.g. the parent task was filtered out, excluded by scope/criteria, lives in a workspace not fetched, or the id is stale/wrong after a ClickUp move or deletion.","commonSituations":"Partial imports limited to certain ClickUp lists/spaces where children were fetched but parents were not; parent tasks deleted or moved in ClickUp before import; custom id fields mapping stale ids; closed/archived parent tasks excluded by import filters.","solutions":["Check the reported parent id: confirm that task exists and is included in the import selection","Widen the import scope so parent tasks are fetched alongside their children","Fix or clear the parent id on the ClickUp task (the child's parent link may be stale)","Re-run the import after the parent task is present in the dataset"],"exampleFix":"// before\n// importing only tasks from one ClickUp list; child references a parent in another list\nconst issues = await fetchTasks(listA)\n// after\n// include parent tasks across the workspace/space so parent ids resolve\nconst issues = await fetchTasks(space) // parents and children together\nconst parent = importIssuesByClickupId.get(child.clickupParentId)\nif (parent === undefined) console.warn('skipping orphan', child.id)","handlingStrategy":"validation","validationCode":"for (const [id, issue] of importIssuesByClickupId) {\n  const pid = issue.clickupParentId\n  if (pid && !importIssuesByClickupId.has(pid)) {\n    console.warn(`orphan task ${id}: parent ${pid} missing from import set`)\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importer.processClickupTasks(tasks)\n} catch (err) {\n  const m = /Parent not found: (\\S+) \\(for task: (\\S+)\\)/.exec((err as Error).message)\n  if (m) console.error(`re-import including parent ${m[1]} for task ${m[2]}`)\n  throw err\n}","preventionTips":["Import parent tasks together with children (same scope/space)","Warn on unresolved parent ids before running the import","Watch for ClickUp task moves/deletes that orphan children","Keep id mappings fresh between ClickUp and Huly"],"tags":["import","clickup","data-integrity","referential-integrity"],"backgroundTag":"referenced-entity-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}