zentao-api
Original:🇨🇳 Chinese
Translated
1 scripts
Call ZenTao RESTful API v2.0 to fulfill user requests, covering add, delete, modify, query and status flow operations for 20 modules including program, product, project, execution, requirement (Story/Epic/Requirement), Bug, task, test case, test task, product plan, build, release, feedback, ticket, application, user, file, etc. This skill is used when users mention project management related operations such as ZenTao, querying project progress, obtaining Bug list, updating requirement status, creating tasks, etc.
6installs
Sourceeasysoft/zentao-skills
Added on
NPX Install
npx skill4agent add easysoft/zentao-skills zentao-apiTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →ZenTao API v2.0
Configuration
Priority from highest to lowest:
| Variable | Description |
|---|---|
| Server address, e.g. |
| Specify token directly, skip login and cache (highest priority), server address is still required |
| Login account, optional when token is provided, but providing it can better answer questions related to the current user |
| Login password, no need to provide when token is available |
After the first login, , , will be written to , no need to set them repeatedly later.
ZENTAO_URLZENTAO_TOKENZENTAO_ACCOUNT~/.zentao-token.jsonIf necessary variables are missing, prompt the user and provide the command. If the user directly provides the server, account and password, use them directly, and inform the user to set them as environment variables as much as possible.
exportAuthentication Process
All business APIs need to carry in the Header. Run to get it automatically:
tokenscripts/get-token.shbash
eval "$(bash scripts/get-token.sh)"
# After execution, you can directly use $ZENTAO_URL, $ZENTAO_TOKEN, $ZENTAO_ACCOUNTScript dependencies: ,
curlnodeAll subsequent request Headers carry:
token: $ZENTAO_TOKENSteps to Execute API Calls
- Run to obtain credentials (automatically handle cache; prompt the user if still missing)
eval "$(bash scripts/get-token.sh)" - Select the correct API endpoint according to user intent (see api-reference.md)
- If it is a PUT edit operation and the user does not provide all required fields, first call the corresponding GET detail interface to retrieve the current data, then overwrite the fields specified by the user
- Construct the request (method, URL, Header, Body) and confirm the write operation content with the user
- Execute the request and parse the response
- Display the results to the user in a clear and readable format
Module Overview
API base path:
$ZENTAO_URL/api.php/v2| Module | Resource Path | Supported Operations |
|---|---|---|
| Program | | CRUD + associated product/project list |
| Product | | CRUD + associated requirements/Bugs/test cases/plans/releases/feedback/tickets/test tasks/applications |
| Project | | CUD + associated executions/requirements/Bugs/test cases/builds/test tasks |
| Execution | | CRUD + associated requirements/tasks/Bugs/test cases/builds/test tasks |
| Story | | CRUD + change/close/activate |
| Epic | | CRUD + change/close/activate |
| Requirement | | CRUD + change/close/activate |
| Bug | | CRUD + resolve/close/activate |
| Task | | CRUD + start/finish/close/activate |
| Testcase | | CRUD |
| Productplan | | CUD + query list by product |
| Build | | CUD + query list by project/execution |
| Release | | CUD + query list by product |
| Testtask | | CUD + query list by product/project/execution |
| Feedback | | CRUD + close/activate |
| Ticket | | CRUD + close/activate |
| System | | CU + query list by product |
| User | | CRUD |
| File | | Edit name + Delete |
CRUD = Create(POST) + Read(GET) + Update(PUT) + Delete(DELETE); CUD = No independent global list interface
Pagination and Filtering
All list interfaces support unified query parameters:
| Parameter | Description |
|---|---|
| Filter status, e.g. |
| Sort, format |
| Number of items per page, maximum 1000 |
| Page number, starting from 1 |
Inconsistent filter parameter names: Program list, Execution global list, Task list use , others use .
statusbrowseTypeCommon Operation Examples
Get ongoing projects and their executions
bash
curl -s "$ZENTAO_URL/api.php/v2/projects?browseType=doing&recPerPage=100" -H "token: $ZENTAO_TOKEN"
curl -s "$ZENTAO_URL/api.php/v2/projects/{projectID}/executions?browseType=doing" -H "token: $ZENTAO_TOKEN"Create a requirement (Required: productID, title)
bash
curl -s -X POST "$ZENTAO_URL/api.php/v2/stories" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"productID": 1, "title": "Requirement title", "pri": 3, "assignedTo": "admin", "spec": "Requirement description"}'Create a Bug (Required: productID, title, openedBuild)
bash
curl -s -X POST "$ZENTAO_URL/api.php/v2/bugs" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"productID": 1, "title": "Bug title", "openedBuild": ["trunk"], "severity": 2, "type": "codeerror"}'Resolve a Bug (Required: resolution)
bash
curl -s -X PUT "$ZENTAO_URL/api.php/v2/bugs/{bugID}/resolve" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"resolution": "fixed"}'Create a task (Required: name, executionID)
bash
curl -s -X POST "$ZENTAO_URL/api.php/v2/tasks" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"executionID": 1, "name": "Task name", "type": "devel", "assignedTo": "admin", "estimate": 4}'Finish a task (Required: currentConsumed, realStarted, finishedDate)
bash
curl -s -X PUT "$ZENTAO_URL/api.php/v2/tasks/{taskID}/finish" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"currentConsumed": 4, "realStarted": "2026-03-25", "finishedDate": "2026-03-25"}'Close a requirement (Required: closedReason)
bash
curl -s -X PUT "$ZENTAO_URL/api.php/v2/stories/{storyID}/close" \
-H "token: $ZENTAO_TOKEN" -H "Content-Type: application/json" \
-d '{"closedReason": "done"}'Common Enumeration Value Quick Reference
| Field | Optional Values |
|---|---|
Project mode | |
Bug type | |
Bug resolution | |
Requirement closing reason | |
Requirement source | |
Requirement category | |
Test case type | |
Test task type | |
Release status | |
Feedback closing reason | |
Ticket type | |
Product type | |
Product access control | |
Execution type | |
Intent Recognition Rules
| User intent keywords | Corresponding operation |
|---|---|
| Ongoing execution/iteration/Sprint | GET /projects?browseType=doing → GET /projects/{id}/executions |
| Get all products/projects/programs | GET /products, /projects, /programs |
| Bugs of a product/project/execution | GET /products/{id}/bugs, /projects/{id}/bugs, /executions/{id}/bugs |
| Create/add Bug | POST /bugs (Required: productID, title, openedBuild) |
| Update/modify Bug | PUT /bugs/{id} |
| Resolve Bug | PUT /bugs/{id}/resolve (Required: resolution) |
| Close Bug | PUT /bugs/{id}/close |
| Activate Bug | PUT /bugs/{id}/activate |
| Create requirement | POST /stories (Required: productID, title) |
| Close/activate/change requirement | PUT /stories/{id}/close, /activate, /change |
| Epic | /epics (same structure as stories) |
| Requirement | /requirements (same structure as stories) |
| Create task | POST /tasks (Required: name, executionID) |
| Start task | PUT /tasks/{id}/start (Required: realStarted) |
| Finish task | PUT /tasks/{id}/finish (Required: currentConsumed, realStarted, finishedDate) |
| Close task | PUT /tasks/{id}/close |
| Test case | /testcases (CRUD) |
| Test task | /testtasks (CUD + query list by product/project/execution) |
| Product plan | /productplans (CUD + query list by product) |
| Build | /builds (CUD + query list by project/execution) |
| Release | /releases (CUD + query list by product) |
| Feedback | /feedbacks (CRUD + close/activate) |
| Ticket | /tickets (CRUD + close/activate) |
| Application/system | /systems (CU + query list by product) |
| Get user list | GET /users |
Notes
- in the URL needs to be replaced with the actual ID; if you don't know the ID, call the list interface first to get it
{id} - PUT edit interface: First GET the details to get the current complete data, then overwrite the fields modified by the user and submit together
- Status flow operations (resolve/close/activate/start/finish/change) usually have independent required fields, no need to GET details first
- Confirm with the user before write operations, execute directly if the user explicitly requests no confirmation
- 401 response indicates that the token has expired, execute to clear the cache and run again
rm ~/.zentao-token.json - Note on inconsistent field names: POST builds use , PUT builds use
executionID; the module field of PUT testcases isexecution(spelling in the specification)moudule
Complete API Reference
For detailed endpoint lists, required/optional fields, enumeration values and query parameters, see api-reference.md.
Backup Resources
- ZenTao API 2.0 official documentation: https://www.zentao.net/book/api/2309.html
- 1.0 API documentation (backup): https://www.zentao.net/book/api/1397.html