Skip to content

Fix custom fields not being sent in API payload#16

Open
roromedia wants to merge 1 commit into
AndyEverything:mainfrom
roromedia:main
Open

Fix custom fields not being sent in API payload#16
roromedia wants to merge 1 commit into
AndyEverything:mainfrom
roromedia:main

Conversation

@roromedia

Copy link
Copy Markdown

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

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>
kingfly55 pushed a commit to kingfly55/openproject-mcp-server that referenced this pull request Apr 17, 2026
…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>
kingfly55 pushed a commit to kingfly55/openproject-mcp-server that referenced this pull request Apr 17, 2026
@AndreaV-Lsi

AndreaV-Lsi commented Jul 16, 2026

Copy link
Copy Markdown

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 custom_fields entry point to feed the client passthrough (a client-only change would otherwise be unreachable in our layout). It's covered by unit tests and a live round-trip test on OpenProject 17.5.1. You're credited as co-author on the commit and in our NOTICE, and it stays under the project's MIT license.

Integrated into our main branch: LS-Instruments@ba31e5b.

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.

AndreaV-Lsi added a commit to LS-Instruments/openproject-mcp-server that referenced this pull request Jul 16, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants