Skip to content

setFieldsInProject ignores project parameter, uses session.getProject() instead #11

@elvinlemmens-fb

Description

@elvinlemmens-fb

Bug description
When calling setFields / setField via the SDK in a CLI/API context (e.g. through an MCP server), field updates silently fail with an HTTP 403. The root cause is that setFieldsInProject receives the correct project name as a parameter but ignores it, calling this.getProject() instead — which returns "" in any context where the session project has not been explicitly set.

Call stack

Project.setField(itemId, fieldName, value)              // line 7776
  → Project.setFields(itemId, data)                     // line 7789
  → Server.setFieldsInProject(this.name, ...)           // line 7790 — "this.name" is correct ✓
  → Server.setFieldsInProject(project, ...)             // line 181232 — "project" param is correct ✓
  → this.appUpdateItemInDBAsync(this.getProject(), ...) // line ~181254 — BUG: ignores "project" param
                                 ^^^^^^^^^^^^^^^^
                                 returns "" in CLI context → URL becomes /rest/1//item/REQ-1 → 403

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions