Skip to content

fix(story): move productID from request body to query string - #6

Open
rioliu wants to merge 2 commits into
easysoft:mainfrom
rioliu:main
Open

fix(story): move productID from request body to query string#6
rioliu wants to merge 2 commits into
easysoft:mainfrom
rioliu:main

Conversation

@rioliu

@rioliu rioliu commented Aug 4, 2026

Copy link
Copy Markdown

Problem

zentao story create fails with:

Missing required parameter: productID.

ZenTao v2 API requires productID as a URL query parameter for story creation, but the SDK sends it in the request body.

Approach Request Result
Current (buggy) POST /api.php/v2/stories body: {"productID":3,...} ❌ Missing required parameter
Fixed POST /api.php/v2/stories?productID=3 body: {"title":"test",...} ✅ Success

Changes

src/modules/generated.ts

  • Move productID from requestBody.schema.properties to params array for the story/create action
  • Remove productID from the required array in the body schema

src/modules/resolve.ts

  • Add productIDproduct fallback in buildQuery(), matching the existing pageIDpage pattern
  • This maintains backward compatibility: users can pass either --product=3 or --productID=3

Testing

Verified locally:

  • zentao story create --product=3 --title="test" --reviewer=admin works
  • ✅ MCP tool (zentao_story create) works
  • ✅ Claude Code integration works

Related Issues

rioliu added 2 commits August 4, 2026 13:23
ZenTao v2 API requires productID as a URL query parameter for story
creation, but the SDK was sending it in the request body, causing
'Missing required parameter: productID' errors.

Changes:
- generated.ts: Move productID from requestBody schema to params array
  for the story/create action, so it's sent as a query parameter
- resolve.ts: Add productID -> product fallback in buildQuery, matching
  the existing pageID -> page pattern for backward compatibility

Fixes easysoft/zentao-cli#13
Fixes easysoft/zentao-cli#14
…ctplan

Apply the same fix as story/create to other modules that require
productID as a query parameter:

- bug/create: move productID from requestBody to params
- epic/create: move productID from requestBody to params
- requirement/create: move productID from requestBody to params
- productplan/create: move productID from requestBody to params

All these modules now work with the ZenTao v2 API.
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.

bug: story create fails with 'Missing required parameter: productID' on ZenTao 22.3 通过cli需求创建失败

1 participant