Fix custom fields not being sent in API payload#16
Conversation
Custom fields were passed through the tool handler but never copied to the API payload in create_work_package and update_work_package client methods. Added handling for customField* keys: - List-type fields (with href) go to payload["_links"] - Text/number fields go directly to payload Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…yload Custom fields were passed through the tool handler but never copied to the API payload in create_work_package and update_work_package client methods. Added handling for customField* keys: list-type fields (with href) go to payload["_links"], text/number fields go directly to payload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for this, @roromedia — you correctly identified that custom fields never reached the work-package payload. For transparency on where it has landed: LS Instruments maintains an actively developed downstream fork of this project (https://github.com/LS-Instruments/openproject-mcp-server) that we're advancing for day-to-day agentic project management on OpenProject. Given the current upstream review cadence we're maintaining that fork independently for now. As part of that we've integrated your fix and extended it: our fork builds the API payload from explicit parameters, so we added a tool-level Integrated into our We'd gladly contribute this back upstream if review capacity returns, and you're welcome to draw from our fork in the meantime. Thanks again. |
Adds a custom_fields mapping to create_work_package / update_work_package so
work packages can carry custom fields (customField1, customField2, ...):
- Client: 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).
- Tools: new optional custom_fields: Dict[str, Any] on CreateWorkPackageInput and
UpdateWorkPackageInput, merged into the request data.
Based on upstream PR AndyEverything#16 by @roromedia; extended
with the tool-level entry point this fork needs (its tools build the payload from
explicit model fields, so a client-only change would never receive custom fields).
Network-free unit test covers the client mapping (text direct vs href in _links),
the no-custom-fields case, and tool forwarding. Verified end to end against an
ephemeral OpenProject 17: a string custom field set via both create and update and
read back.
Closes #14
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: roromedia <roromedia@users.noreply.github.com>
Custom fields were passed through the tool handler but never copied to the API payload in create_work_package and update_work_package client methods.
Added handling for customField* keys: