版本

创建版本 分享链接 /book/api/706.html

作者:王怡栋 最后编辑:宋辰轩 于 2024-09-30 15:04:11 浏览量:8003
POST
/projects/id/builds

创建版本

请求URL

https://xxx.com/api.php/v1/projects/id/builds

请求头

名称 类型 必填 描述
Token String 认证凭证Token

请求体

名称 类型 必填 描述
execution int 所属执行
product int 所属产品
branch int 所属分支
name string 版本名称
builder string 构建者
date date 打包日期
scmPath string 源代码地址
filePath string 下载地址
desc string 版本描述

请求示例

{
    "name": "test",
    "product": 4,
    "date": "2021-01-01",
    "execution": 42,
    "builder": "admin"
}

请求响应

名称 类型 必填 描述
id int 版本ID
project int 所属项目
product int 所属产品
branch int 所属产品分支(主分支为0)
execution int 所属执行
name string 版本名称
scmPath string 源代码地址
filePath string 下载地址
desc string 版本描述
builder 构建者
date date 打包日期

响应示例

{
    "id": 3,
    "project": 41,
    "product": 4,
    "branch": 0,
    "execution": 42,
    "name": "test",
    "scmPath": "",
    "filePath": "",
    "date": "2021-01-01",
    "stories": "",
    "bugs": "",
    "builder": "admin",
    "desc": "",
    "deleted": "0",
    "executionName": "testt",
    "productName": "多分支产品",
    "productType": "branch",
    "files": []
}
评论列表
帅气的上铺 2025-04-16 15:49:23 回复
您好,我在使用构建的API时遇到2个问题,
1、使用2.11.3 创建版本接口,对比页面上的操作,缺少关联应用的功能;
2、要通过API做关联构建和解决的BUG,要使用哪个接口?
回复
第1个问题,接口滞后了,不能支持该功能
第2个问题,不能使用 restful api 实现。

以上2个问题,可以调用通过 zentaosid 方式解决

https://www.zentao.net/book/extension-dev/1341.html

它的工作原理是
1,获取用户sessionID
2,模拟浏览器的表单提交操作(可以到具体的页面通过浏览器发送的请求头,看参数名和参数值 , 附件的话也可以传递以数据流的方式)
🌃
禅道1263 2023-12-26 13:23:41 回复
使用此接口创建版本可以添加图片和附件吗?
回复
可以通过files[]参数上传附件看下
魏中显
高级客户经理
18561939726
1746749398
统一服务热线 4006-8899-23
我要提问提问有任何问题,您都可以在这里提问。 问题反馈反馈点击这里,让我们聆听您的建议与反馈。