{"record":{"id":"c35d04d5403b8dad","repo":"hcengineering/platform","slug":"person-not-found-name","errorCode":null,"errorMessage":"Person not found: ${name}","messagePattern":"Person not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/importer/src/huly/huly.ts","lineNumber":523,"sourceCode":"        // Process sub-issues if they exist\n        const subDir = path.join(currentPath, issueFile.replace('.md', ''))\n        if (fs.existsSync(subDir) && fs.statSync(subDir).isDirectory()) {\n          await this.processIssuesRecursively(builder, projectIdentifier, projectPath, subDir, issuePath)\n        }\n      } else {\n        throw new Error(`Unknown issue class ${issueHeader.class} in ${issueFile}`)\n      }\n    }\n  }\n\n  private findPersonByName (name?: string): Ref<Person> | undefined {\n    if (name === undefined) {\n      return undefined\n    }\n\n    const person = this.personsByName.get(name)\n    if (person === undefined) {\n      throw new Error(`Person not found: ${name}`)\n    }\n    return person\n  }\n\n  private async getPersonIdByEmail (email: string): Promise<PersonId> {\n    const personId = this.personIdByEmail.get(email)\n    if (personId !== undefined) {\n      return personId\n    }\n\n    const socialId = await this.client.findOne(contact.class.SocialIdentity, {\n      type: SocialIdType.EMAIL,\n      value: email\n    })\n\n    if (socialId === undefined) {\n      throw new Error(`Social ID not found for email: ${email}`)\n    }","sourceCodeStart":505,"sourceCodeEnd":541,"githubUrl":"https://github.com/hcengineering/platform/blob/63e28dc96483967b2fc21c881b3f1023c1de7718/packages/importer/src/huly/huly.ts#L505-L541","documentation":"findPersonByName resolves a person name from imported content (e.g. an issue's author or assignee field) against the in-memory map of persons loaded from the target workspace. If the name is not present in that map, it throws rather than returning a dangling reference. Undefined names are tolerated and return undefined; only an actual, unresolvable name throws.","triggerScenarios":"An imported issue/comment header references a person by name (called from issue processing) that does not exist among persons registered in the importer's personsByName map — e.g. the user left the workspace, was renamed, or the name has different spelling/casing/whitespace.","commonSituations":"Export from workspace A imported into workspace B where the named user does not exist; a user renamed their account between export and import; extra spaces or different casing in the name field of the markdown front-matter; deactivated or removed accounts.","solutions":["Ensure the named person exists in the target Huly workspace (create/invite the user) with exactly the same display name","Fix the name in the source markdown front-matter to match an existing person exactly (case and spacing)","Re-export after user accounts are corrected in the source workspace","Replace references to departed users with an existing account name"],"exampleFix":"// before (issue front-matter)\nassignee: John Doe\n// after (matching an existing person exactly)\nassignee: John M. Doe","handlingStrategy":"try-catch","validationCode":"// pre-check names referenced in issue front-matter against workspace persons\nfor (const name of referencedPersonNames(issueFiles)) {\n  if (!workspacePersonNames.has(name)) console.warn(`Person \"${name}\" missing in target workspace`)\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importer.workspaceData(folder)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Person not found:')) {\n    const name = e.message.slice('Person not found:'.length).trim()\n    console.error(`Create or rename a user to \"${name}\" in the target workspace, then retry`)\n  } else throw e\n}","preventionTips":["Import into a workspace that contains all users referenced by the export, with identical display names","Normalize names (trim whitespace, consistent casing) in exported front-matter","Re-export after user renames so names stay in sync","Audit assignee/author fields against the target workspace's user list before importing"],"tags":["importer","person-lookup","data-mismatch"],"backgroundTag":"referenced-entity-not-found","analyzedSha":"63e28dc96483967b2fc21c881b3f1023c1de7718","analyzedAt":"2026-08-29T15:21:27.377Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}