hcengineering/platform · error

Parent not found: ${issue.clickupParentId} (for task: ${clic

Error message

Parent not found: ${issue.clickupParentId} (for task: ${clickupId})

What it means

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.

Source

Thrown at packages/importer/src/clickup/clickup.ts:163

    const importProjectsByName = new Map<string, ImportProject>()
    for (const projectName of projects) {
      const identifier = this.getProjectIdentifier(projectName)
      importProjectsByName.set(projectName, {
        class: tracker.class.Project,
        title: projectName,
        identifier,
        private: false,
        autoJoin: false,
        projectType: importProjectType,
        docs: []
      })
    }

    for (const [clickupId, issue] of importIssuesByClickupId) {
      if (!this.clickupBlankString(issue.clickupParentId)) {
        const parent = importIssuesByClickupId.get(issue.clickupParentId as string)
        if (parent === undefined) {
          throw new Error(`Parent not found: ${issue.clickupParentId} (for task: ${clickupId})`)
        }
        parent.subdocs.push(issue)
      } else if (!this.clickupBlankString(issue.clickupProjectName)) {
        const project = importProjectsByName.get(issue.clickupProjectName as string)
        if (project === undefined) {
          throw new Error(`Project not found: ${issue.clickupProjectName} (for task: ${clickupId})`)
        }
        project.docs.push(issue)
      } else {
        throw new Error(`Task cannot be imported: ${clickupId} (No parent)`)
      }
    }

    return {
      projects: Array.from(importProjectsByName.values()),
      projectType: importProjectType
    }
  }

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Check the reported parent id: confirm that task exists and is included in the import selection
  2. Widen the import scope so parent tasks are fetched alongside their children
  3. Fix or clear the parent id on the ClickUp task (the child's parent link may be stale)
  4. Re-run the import after the parent task is present in the dataset

Example fix

// before
// importing only tasks from one ClickUp list; child references a parent in another list
const issues = await fetchTasks(listA)
// after
// include parent tasks across the workspace/space so parent ids resolve
const issues = await fetchTasks(space) // parents and children together
const parent = importIssuesByClickupId.get(child.clickupParentId)
if (parent === undefined) console.warn('skipping orphan', child.id)
Defensive patterns

Strategy: validation

Validate before calling

for (const [id, issue] of importIssuesByClickupId) {
  const pid = issue.clickupParentId
  if (pid && !importIssuesByClickupId.has(pid)) {
    console.warn(`orphan task ${id}: parent ${pid} missing from import set`)
  }
}

Try / catch

try {
  await importer.processClickupTasks(tasks)
} catch (err) {
  const m = /Parent not found: (\S+) \(for task: (\S+)\)/.exec((err as Error).message)
  if (m) console.error(`re-import including parent ${m[1]} for task ${m[2]}`)
  throw err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of hcengineering/platform@63e28dc964 (2026-08-29). Data as JSON: /api/errors/1910817d73428081. Report an issue: GitHub.