{"record":{"id":"fe9740326c61659a","repo":"hcengineering/platform","slug":"task-cannot-be-imported-clickupid-no-parent","errorCode":null,"errorMessage":"Task cannot be imported: ${clickupId} (No parent)","messagePattern":"Task cannot be imported: (.+?) \\(No parent\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/clickup/clickup.ts","lineNumber":173,"sourceCode":"        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  }\n\n  private clickupBlankString (str: string | undefined): boolean {\n    if (str === undefined || str === null) return true\n    return str.trim().length === 0 || str === 'null'\n  }\n\n  private async convertToImportIssue (clickup: ClickupTask): Promise<ImportIssue> {\n    const status = {\n      name: clickup.Status\n    }","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/clickup/clickup.ts#L155-L191","documentation":"`processClickupTasks` throws this when an issue has neither a usable parent id nor a project name — there is no place to attach the task in the imported hierarchy. The task is declared unimportable and the whole import run aborts.","triggerScenarios":"An issue in the ClickUp export has a blank `clickupParentId` AND a blank `clickupProjectName`, so both the subdoc branch and the project branch are skipped and the else branch throws.","commonSituations":"Tasks created at the ClickUp workspace root with no list/space project mapping; custom-field mapping not configured so parent/project fields come through empty; tasks detached from their list before export.","solutions":["Assign the task to a project/list in ClickUp, or set its parent task, then re-export and re-import","Check the field mapping so clickupProjectName/clickupParentId are actually populated from ClickUp","Exclude rootless orphan tasks from the import if they are not needed","Pre-filter the dataset before processing to skip or rehome tasks lacking both fields"],"exampleFix":"// before\n// task with no parent and no project in the export\n{ id: 'task7', clickupParentId: '', clickupProjectName: '' }\n// after\n// in ClickUp, move task7 into a list or set a parent, then re-export\n{ id: 'task7', clickupParentId: '', clickupProjectName: 'Design' }","handlingStrategy":"validation","validationCode":"for (const [id, issue] of importIssuesByClickupId) {\n  if (!issue.clickupParentId?.trim() && !issue.clickupProjectName?.trim()) {\n    console.warn(`task ${id} has no parent and no project; rehome or exclude before import`)\n  }\n}","typeGuard":"function hasPlacement(issue: { clickupParentId?: string; clickupProjectName?: string }): boolean {\n  return Boolean(issue.clickupParentId?.trim() || issue.clickupProjectName?.trim())\n}","tryCatchPattern":"try {\n  await importer.processClickupTasks(tasks)\n} catch (err) {\n  if (/Task cannot be imported/.test((err as Error).message)) {\n    console.error('rehome the listed task in ClickUp, then re-export')\n  }\n  throw err\n}","preventionTips":["Ensure every ClickUp task belongs to a list or has a parent before export","Verify custom-field mappings populate parent/project fields","Pre-filter rootless orphan tasks out of the dataset","Re-export after reorganizing tasks in ClickUp"],"tags":["import","clickup","data-integrity","mapping"],"backgroundTag":"referenced-entity-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}