{"record":{"id":"1a30e852c1aa0783","repo":"ruvnet/ruflo","slug":"issue-not-found","errorCode":"ISSUE_NOT_FOUND","errorMessage":"Issue ${issueId} not found","messagePattern":"Issue (.+?) not found","errorType":"exception","errorClass":"ClaimOperationError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/claims/src/application/claim-service.ts","lineNumber":580,"sourceCode":"    }\n  }\n\n  // ==========================================================================\n  // Queries\n  // ==========================================================================\n\n  async getClaimedBy(claimant: Claimant): Promise<IssueClaim[]> {\n    return this.claimRepository.findByClaimant(claimant);\n  }\n\n  async getAvailableIssues(filters?: IssueFilters): Promise<Issue[]> {\n    return this.issueRepository.findAvailable(filters);\n  }\n\n  async getIssueStatus(issueId: string): Promise<IssueWithClaim> {\n    const issue = await this.issueRepository.findById(issueId);\n    if (!issue) {\n      throw new ClaimOperationError('ISSUE_NOT_FOUND', `Issue ${issueId} not found`);\n    }\n\n    const claim = await this.claimRepository.findByIssueId(issueId);\n    const pendingHandoffs = claim?.handoffChain?.filter((h) => h.status === 'pending') ?? [];\n\n    return {\n      issue,\n      claim,\n      pendingHandoffs,\n    };\n  }\n\n  // ==========================================================================\n  // Auto-management\n  // ==========================================================================\n\n  async expireStale(maxAge: Duration): Promise<IssueClaim[]> {\n    const maxAgeMs = durationToMs(maxAge);","sourceCodeStart":562,"sourceCodeEnd":598,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/claims/src/application/claim-service.ts#L562-L598","documentation":"Thrown by the query method getIssueStatus when issueRepository.findById(issueId) returns null. This is distinct from NOT_CLAIMED: here the Issue itself does not exist (the claim is queried only after the issue is confirmed). Use this to detect that an issue id was never imported into the issue repository.","triggerScenarios":"Querying an issue id that was never created/imported into issueRepository; the issue was deleted; the id belongs to a different persistence backend or tenant; typo in the id.","commonSituations":"issueId sourced from an external tracker (Jira/GitHub) that has not been synced into issueRepository; multi-tenant store isolation; stale bookmark/URL.","solutions":["Confirm the issue id exists in the issue repository before querying status.","Import/sync the issue via the issue repository's create method if it legitimately should exist.","Handle the error as a 404/not-found at the API boundary and inform the caller.","Verify the issueId string and the repository instance backing the service."],"exampleFix":"// before\nconst status = await claimService.getIssueStatus(issueId); // throws ISSUE_NOT_FOUND\n\n// after\nlet status;\ntry {\n  status = await claimService.getIssueStatus(issueId);\n} catch (e) {\n  if (e instanceof ClaimOperationError && e.code === 'ISSUE_NOT_FOUND') {\n    return { notFound: true };\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":"const issue = await issueRepository.findById(issueId);\nif (!issue) {\n  return { notFound: true };\n}\nconst status = await claimService.getIssueStatus(issueId);","typeGuard":null,"tryCatchPattern":"try {\n  return await claimService.getIssueStatus(issueId);\n} catch (e) {\n  if (e instanceof ClaimOperationError && e.code === 'ISSUE_NOT_FOUND') {\n    return { notFound: true };\n  }\n  throw e;\n}","preventionTips":["Import/sync issues into issueRepository before exposing them to claim workflows.","Surface ISSUE_NOT_FOUND as an HTTP 404 at the API boundary.","Validate issueId format and tenant scope before querying."],"tags":["claims","query","issue-not-found","not-found"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}