paperclipai/paperclip · error

Issue does not belong to company

Error message

Issue does not belong to company

What it means

422 from POST /companies/:companyId/issues/:issueId/attachments. Fires after the issue is resolved but its companyId differs from the companyId path parameter — the attachment endpoint requires the issue to actually belong to the named company.

Source

Thrown at server/src/routes/issues.ts:13652

      return;
    }
    const includePayload = parseBooleanQuery(req.query.includePayload) || req.query.includePayload === undefined;
    const trace = await feedback.getFeedbackTraceById(traceId, includePayload);
    if (!trace || !actorCanAccessCompany(req, trace.companyId)) {
      res.status(404).json({ error: "Feedback trace not found" });
      return;
    }
    res.json(trace);
  });

  router.get("/feedback-traces/:traceId/bundle", async (req, res) => {
    const traceId = req.params.traceId as string;
    if (req.actor.type !== "board") {
      res.status(403).json({ error: "Only board users can view feedback trace bundles" });
      return;
    }
    const bundle = await feedback.getFeedbackTraceBundle(traceId);
    if (!bundle || !actorCanAccessCompany(req, bundle.companyId)) {
      res.status(404).json({ error: "Feedback trace not found" });
      return;
    }
    res.json(bundle);
  });

  router.post("/issues/:id/comments", validate(addIssueCommentSchema), async (req, res) => {
    const id = req.params.id as string;
    const issue = await getAccessibleResource(req, res, svc.getById(id), "Issue not found");
    if (!issue) return;
    if (req.actor.type === "agent" && req.body.onBehalfOfUserId != null) {
      await auditAgentIssueCommentAttributionSpoof({
        db,
        req,
        issue,
        surface: "issue.comment.create",
        requestedValue: readNonEmptyString(req.body.onBehalfOfUserId),
      });

View on GitHub (pinned to 01ad858492)

Solutions

  1. Correct the request so it satisfies the condition stated in the error message, then retry; see the throwing line in the named file for the exact check.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/issues.ts:12633 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/9fbbb5171267624e. Report an issue: GitHub.