获取企业Issue自定义字段列表¶
GET /api/v8/enterprises/{enterprise_id}/issue_extend_field
获取指定企业下 Issue 自定义字段的列表。
访问令牌支持说明¶
- AtomGit 用户访问令牌(AtomGit user access tokens)
是否允许匿名访问¶
此接口不允许匿名访问
请求参数¶
| 参数名 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
enterprise_id |
path | string | 是 | 企业 id |
access_token |
query | string | 是 | 用户授权码 |
page |
query | string | 否 | 当前的页码,默认为 1 |
per_page |
query | string | 否 | 每页的数量,最大为 100,默认为 20 |
响应参数¶
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
id |
integer | 是 | 否 | id |
name |
string | 是 | 否 | 字段名称 |
description |
string | 是 | 否 | 字段描述 |
field_type |
string | 是 | 否 | 自定义字段的类型。枚举:text_single:单行文本,text_multi:多行文本,integer:整数,decimal:小数,date:日期,select_single:单选下拉,select_multi:多选下拉,member_single:单选成员,member_multi:多选成员 |
field_visibility |
integer | 是 | 否 | 可见性。0:仅管理员可见,1:所有人可见 |
created_time |
string | 是 | 否 | 创建时间 |
updated_time |
string | 是 | 否 | 更新时间 |
options |
object[] | 是 | 否 | 选项明细,仅选项类型返回 |
types |
object[] | 是 | 否 | 该字段关联的 issue 类型列表 |
options 对象¶
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
options.id |
integer | 是 | 否 | id |
options.extend_field_id |
integer | 是 | 否 | 自定义字段 id |
options.sort_num |
integer | 是 | 否 | 排序号 |
options.field_value |
string | 是 | 否 | 选项值 |
options.created_time |
string | 是 | 否 | 创建时间 |
options.updated_time |
string | 是 | 否 | 更新时间 |
types 对象¶
| 字段 | 类型 | 必返 | 可为空 | 说明 |
|---|---|---|---|---|
types.id |
integer | 是 | 否 | id |
types.name |
string | 是 | 否 | 类型名称 |
types.desc |
string | 是 | 否 | 描述 |
types.enabled |
boolean | 是 | 否 | 是否启用 |
types.sort_num |
integer | 是 | 否 | 排序号 |
types.kind |
integer | 是 | 否 | 类型分类 |
失败响应¶
400 参数错误
401 未认证
错误响应字段名以后端实际返回为准。
HTTP 响应状态码¶
| 状态码 | 说明 |
|---|---|
200 |
成功(OK) |
400 |
参数错误(Bad request) |
401 |
需要认证(Requires authentication) |
403 |
禁止访问(Forbidden) |
404 |
请求路径不存在(Not found) |
500 |
系统内部错误(Internal server error) |
请求示例¶
参数说明¶
示例统一使用 https://atomgit.com 作为访问地址。
<enterprise_id>替换为企业的 id;<token>替换为你的 AtomGit 用户访问令牌;page与per_page为可选的分页参数。
cURL¶
curl -X GET 'https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issue_extend_field?access_token=<token>&page=1&per_page=20' \
-H 'Accept: application/json'
JavaScript¶
// 原生 fetch (Node.js 18+ / 浏览器)
const response = await fetch(
"https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issue_extend_field?access_token=<token>&page=1&per_page=20",
{
headers: {
"Accept": "application/json",
},
}
);
if (!response.ok) {
throw new Error(`请求失败: ${response.status}`);
}
const data = await response.json();
console.log(data);
Python¶
import requests
resp = requests.get(
"https://api.atomgit.com/api/v8/enterprises/<enterprise_id>/issue_extend_field",
params={
"access_token": "<token>",
"page": 1,
"per_page": 20,
},
headers={
"Accept": "application/json",
},
timeout=10,
)
resp.raise_for_status()
print(resp.json())
响应示例¶
状态码: 200
[
{
"id": 48,
"name": "多选下拉",
"description": "",
"field_type": "select_multi",
"field_visibility": 0,
"created_time": "2025-12-18T14:50:25+08:00",
"updated_time": "2025-12-18T14:50:25+08:00",
"options": [
{
"id": 51,
"extend_field_id": 48,
"sort_num": 9999,
"field_value": "1",
"created_time": "2025-12-18T14:50:34+08:00",
"updated_time": "2025-12-18T14:50:34+08:00"
},
{
"id": 52,
"extend_field_id": 48,
"sort_num": 9999,
"field_value": "2",
"created_time": "2025-12-18T14:50:36+08:00",
"updated_time": "2025-12-18T14:50:36+08:00"
}
],
"types": [
{
"id": 425,
"name": "需求",
"desc": "",
"enabled": true,
"sort_num": 1,
"kind": 0
}
]
},
{
"id": 45,
"name": "test1",
"description": "",
"field_type": "text_single",
"field_visibility": 0,
"created_time": "2025-12-18T10:46:51+08:00",
"updated_time": "2026-01-07T09:22:17+08:00",
"types": []
}
]
错误码¶
| 错误码 | 说明 |
|---|---|
400 |
参数错误或请求无法解析 |
401 |
未认证或凭证无效(缺少/无效的访问凭证) |
403 |
无权限访问该资源 |
404 |
请求路径不存在 |
500 |
系统内部错误 |
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 gitcode-dev/atomgit-api-doc