hcengineering/platform · error

Task cannot be imported: ${clickupId} (No parent)

Error message

Task cannot be imported: ${clickupId} (No parent)

What it means

`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.

Source

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

        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
    }
  }

  private clickupBlankString (str: string | undefined): boolean {
    if (str === undefined || str === null) return true
    return str.trim().length === 0 || str === 'null'
  }

  private async convertToImportIssue (clickup: ClickupTask): Promise<ImportIssue> {
    const status = {
      name: clickup.Status
    }

View on GitHub (pinned to 63e28dc964)

Solutions

  1. Assign the task to a project/list in ClickUp, or set its parent task, then re-export and re-import
  2. Check the field mapping so clickupProjectName/clickupParentId are actually populated from ClickUp
  3. Exclude rootless orphan tasks from the import if they are not needed
  4. Pre-filter the dataset before processing to skip or rehome tasks lacking both fields

Example fix

// before
// task with no parent and no project in the export
{ id: 'task7', clickupParentId: '', clickupProjectName: '' }
// after
// in ClickUp, move task7 into a list or set a parent, then re-export
{ id: 'task7', clickupParentId: '', clickupProjectName: 'Design' }
Defensive patterns

Strategy: validation

Validate before calling

for (const [id, issue] of importIssuesByClickupId) {
  if (!issue.clickupParentId?.trim() && !issue.clickupProjectName?.trim()) {
    console.warn(`task ${id} has no parent and no project; rehome or exclude before import`)
  }
}

Type guard

function hasPlacement(issue: { clickupParentId?: string; clickupProjectName?: string }): boolean {
  return Boolean(issue.clickupParentId?.trim() || issue.clickupProjectName?.trim())
}

Try / catch

try {
  await importer.processClickupTasks(tasks)
} catch (err) {
  if (/Task cannot be imported/.test((err as Error).message)) {
    console.error('rehome the listed task in ClickUp, then re-export')
  }
  throw err
}

Prevention

When it happens

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

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

Related errors


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