You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create_work_package / update_work_package cannot set custom fields.
OpenProject work packages routinely carry custom fields (customField1, customField2,
…) — cost centers, categories, list/enumeration values, etc. Today there is no way
to write them through the MCP server, which blocks real project-management use.
Source / attribution
Based on upstream PR AndyEverything#16 by @roromedia
("Fix custom fields not being sent in API payload"). That PR patches the legacy
monolith and adds only the client-side passthrough. This fork's tools build the
API data dict from explicit Pydantic model fields, so a client-only change would
be dead code — nothing would ever put customField* into data. So this issue ports
the client passthrough and adds the missing tool-level entry point. Author to be
credited in NOTICE.
Scope / proposed approach
Client (src/client.py, create_work_package + update_work_package): after
the standard fields, pass through any data key starting with customField —
a {"href": …} value goes under _links (list/user/version-type fields), any
other value is set directly (text/number/date). (This is feat(sprints): native sprint & backlog management tools (clean implementation) #16's logic, adapted to
our form-based payload builder.)
Tools/models (src/tools/work_packages.py): add an optional custom_fields: Dict[str, Any] field to CreateWorkPackageInput and UpdateWorkPackageInput, and merge it into data before calling the client.
Creating/updating a WP with custom_fields sets both a text/number custom field
(direct value) and a list-type custom field (_links href) in the same request.
Omitting custom_fields changes nothing (no customField*/empty _links noise).
Network-free unit test: given custom_fields, the client payload places text
values directly and href values under _links.
Live smoke on ephemeral OpenProject: define a WP custom field, set it via the
tool, read it back.
Problem / motivation
create_work_package/update_work_packagecannot set custom fields.OpenProject work packages routinely carry custom fields (customField1, customField2,
…) — cost centers, categories, list/enumeration values, etc. Today there is no way
to write them through the MCP server, which blocks real project-management use.
Source / attribution
Based on upstream PR AndyEverything#16 by @roromedia
("Fix custom fields not being sent in API payload"). That PR patches the legacy
monolith and adds only the client-side passthrough. This fork's tools build the
API
datadict from explicit Pydantic model fields, so a client-only change wouldbe dead code — nothing would ever put
customField*intodata. So this issue portsthe client passthrough and adds the missing tool-level entry point. Author to be
credited in
NOTICE.Scope / proposed approach
src/client.py,create_work_package+update_work_package): afterthe standard fields, pass through any
datakey starting withcustomField—a
{"href": …}value goes under_links(list/user/version-type fields), anyother value is set directly (text/number/date). (This is feat(sprints): native sprint & backlog management tools (clean implementation) #16's logic, adapted to
our form-based payload builder.)
src/tools/work_packages.py): add an optionalcustom_fields: Dict[str, Any]field toCreateWorkPackageInputandUpdateWorkPackageInput, and merge it intodatabefore calling the client.Usage:
{"custom_fields": {"customField1": "ACME", "customField5": {"href": "/api/v3/custom_options/12"}}}Acceptance criteria
custom_fieldssets both a text/number custom field(direct value) and a list-type custom field (
_linkshref) in the same request.custom_fieldschanges nothing (nocustomField*/empty_linksnoise).custom_fields, the client payload places textvalues directly and href values under
_links.tool, read it back.
Out of scope
only. Branches off
main(independent of the flattened-tools stack / PR fix: make wrapped tool inputs robust to MCP clients that serialize args as JSON strings AndyEverything/openproject-mcp-server#22).