创建事项
接口描述
中文:创建事项
英文:CreateIssue
输入参数
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:CreateIssue |
ProjectName | 是 | String | 项目名称 |
Type | 是 | String | 事项类型 DEFECT - 缺陷 REQUIREMENT - 需求 MISSION - 任务 EPIC - 史诗 SUB_TASK - 子任务 |
ParentCode | 否 | Integer | 所属事项 Code,Type 为 SUB_TASK 时需指定 |
Name | 是 | String | 事项名称 |
StatusId | 否 | Integer | 事项状态 Id |
AssigneeId | 否 | Integer | 指派人 Id |
Description | 否 | String | 描述 |
DueDate | 否 | String | 截止日期 |
StartDate | 否 | String | 开始日期 |
WorkingHours | 否 | Double | 工时(小时) |
ProjectModuleId | 否 | Integer | 项目模块 Id |
WatcherIds | 否 | Array of Integer | 事项关注人 Id 列表 |
DefectTypeId | 否 | Integer | 项目缺陷类型 Id |
RequirementTypeId | 否 | Integer | 项目需求类型 Id |
Priority | 是 | String | 紧急程度 “0” - 低 “1” - 中 “2” - 高 “3” - 紧急 |
IterationCode | 否 | Integer | 迭代 Code,Type 为 EPIC 或 SUB_TASK 时,忽略该值 |
EpicCode | 否 | Integer | 史诗 Code,Type 为 EPIC 或 SUB_TASK 时,不传该值 |
StoryPoint | 否 | String | 故事点,例如:0.5、1 |
LabelIds | 否 | Array of Integer | 标签 Id 列表 |
FileIds | 否 | Array of Integer | 文件 Id 列表 |
TargetSortCode | 否 | Integer | 排序目标位置的事项 code 可不填,排在底位 |
ThirdLinks | 否 | Array of CreateThirdLinkForm | 第三方链接列表 |
CustomFieldValues | 否 | Array of IssueCustomFieldForm | 自定义属性值列表 |
输出参数
参数名称 | 类型 | 描述 |
---|---|---|
Issue | IssueDetail | 事项信息 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
第三方链接信息
名称 | 必选 | 类型 | 描述 |
---|---|---|---|
ThirdType | 是 | String | 第三方链接类型,MODAO - 墨刀 |
Title | 是 | String | 链接标题 |
Link | 是 | String | 链接地址 |
事项自定义属性
属性的 Id 和取值需先通过「查询属性设置」获取。
名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Id | 是 | Integer | 事项自定义属性 Id |
Content | 是 | String | 自定义属性值 多选值使用逗号 “,” 分隔 |
示例
输入示例
{
"Action":"CreateIssue",
"ProjectName":"demo-project",
"Type":"REQUIREMENT",
"Name":"一个需求",
"Priority":"0",
"CustomFieldValues":[ // 选填
{
"Id":34929409, // 来自 IssueField.Id
"Content":"1"
}
]
}
curl
curl -H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"Action": "CreateIssue","ProjectName": "coding-demo","Type": "REQUIREMENT","Name":"一个需求","Priority":"0","CustomFieldValues":[{"Id":34929409,"Content":"1"}]}' \
-X POST https://e.coding.net/open-api
输出示例
{
"Response": {
"RequestId": "c2e8cdce-9d9f-be99-e209-3dae07b690ac",
"Issue": {
"ParentType": "REQUIREMENT",
"Code": 27,
"Type": "REQUIREMENT",
"Name": "test-20200826-1",
"Description": "",
"IterationId": 0,
"IssueStatusId": 4,
"IssueStatusName": "未开始",
"IssueStatusType": "TODO",
"Priority": "0",
"Assignee": {
"Id": 0,
"Status": 0,
"GlobalKey": "",
"Avatar": "",
"Media": "",
"Name": "",
"Email": ""
},
"StartDate": 0,
"DueDate": 0,
"WorkingHours": 0.0,
"Creator": {
"Id": 1,
"Status": 2,
"GlobalKey": "coding",
"Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
"Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
"Name": "coding",
"Email": ""
},
"StoryPoint": "",
"CreatedAt": 1598843625826,
"UpdatedAt": 1598843625826,
"CompletedAt": 0,
"ProjectModule": {
"Id": 0,
"Name": ""
},
"Watchers": [
{
"Id": 1,
"Status": 2,
"GlobalKey": "coding",
"Avatar": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
"Media": "https://dn-coding-net-production-static.codehub.cn/512b2a62-956b-4ef8-8e84-b3c66e71468f.png?imageMogr2/auto-orient/format/png/crop/!300x300a0a0",
"Name": "coding",
"Email": ""
}
],
"Labels": [],
"Files": [],
"RequirementType": {
"Id": 0,
"Name": ""
},
"DefectType": {
"Id": 0,
"Name": "",
"IconUrl": ""
},
"CustomFields": [],
"ThirdLinks": [],
"SubTasks": [],
"Parent": {
"Code": 0,
"Type": "",
"Name": "",
"IssueStatusId": 0,
"IssueStatusName": "",
"Priority": "",
"Assignee": {
"Id": 0,
"Status": 0,
"GlobalKey": "",
"Avatar": "",
"Media": "",
"Name": "",
"Email": ""
}
},
"Epic": {
"Code": 0,
"Type": "",
"Name": "",
"IssueStatusId": 0,
"IssueStatusName": "",
"Priority": "",
"Assignee": {
"Id": 0,
"Status": 0,
"GlobalKey": "",
"Avatar": "",
"Media": "",
"Name": "",
"Email": ""
}
}
}
}
}

感谢反馈有用
感谢反馈没用