# 说明
计算符合查询条件的任务数量并返回
# url
https://api.tapd.cn/tasks/count
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
只返回任务数量
# 请求参数
| 字段名 | 必选 | 类型及范围 | 说明 | 特殊规则 |
|---|---|---|---|---|
| id | 否 | integer | id | 支持多ID查询、模糊匹配 |
| name | 否 | string | 任务标题 | 支持模糊匹配 |
| description | 否 | string | 任务详细描述 | |
| workspace_id | 是 | integer | 项目ID | |
| creator | 否 | string | 创建人 | 支持模糊匹配 |
| created | 否 | datetime | 创建时间 | 支持时间查询 |
| modified | 否 | datetime | 最后修改时间 | |
| status | 否 | string | 状态 | 支持枚举查询 |
| label | 否 | string | 标签查询 | 支持枚举查询,5月30号上线 |
| owner | 否 | string | 任务当前处理人 | 支持模糊匹配 |
| cc | 否 | string | 抄送人 | |
| begin | 否 | date | 预计开始 | 支持时间查询 |
| due | 否 | date | 预计结束 | 支持时间查询 |
| story_id | 否 | integer | 关联需求的ID | 支持多ID查询 |
| iteration_id | 否 | integer | 所属迭代的ID | |
| priority | 否 | string | 优先级。为了兼容自定义优先级,请使用 priority_label 字段,详情参考:如何兼容自定义优先级 | |
| priority_label | 否 | string | 优先级。推荐使用这个字段 | |
| progress | 否 | integer | 进度 | |
| completed | 否 | datetime | 完成时间 | 支持时间查询 |
| effort_completed | 否 | string | 完成工时 | |
| exceed | 否 | float | 超出工时 | |
| remain | 否 | float | 剩余工时 | |
| effort | 否 | string | 预估工时 | |
| custom_field_* | 否 | string或者integer | 自定义字段参数,具体字段名通过接口 获取任务自定义字段配置 获取 | 支持枚举查询 |
# 调用示例及返回结果
# 获取项目下的任务数量
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' 'https://api.tapd.cn/tasks/count?workspace_id=10158231'
# 返回结果
{
"status": 1,
"data": {
"count": 1
},
"info": "success"
}
1
2
3
4
5
6
7
2
3
4
5
6
7
# 任务状态(status)取值字段说明
| 取值 | 字面值 |
|---|---|
| open | 未开始 |
| progressing | 进行中 |
| done | 已完成 |
# 任务优先级(priority)取值字段说明
为了兼容自定义优先级,请使用 priority_label 字段,详情参考:如何兼容自定义优先级 。下面取值将不再使用。
| 取值 | 字面值 |
|---|---|
| 4 | High |
| 3 | Middle |
| 2 | Low |
| 1 | Nice To Have |