dingtalk.oapi.workspace.task.getbysourceid (根据任务来源source和sourceId获取任务详情)

根据任务来源source和sourceId获取任务详情

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
agent_id Number 可选 1111 微应用agentId
source_id String 必须 tb_1 任务来源sourceId
source String 可选 tb 任务来源source

响应参数

名称 类型 示例值 描述
result Task 响应结果
  • └ gmt_create
  • Date
  • 2020-01-14 14:39:51
  • 创建时间
  • └ modifier_userid
  • String
  • 1
  • 更新者id
  • └ creator_userid
  • String
  • 1
  • 创建者id
  • └ biz_tag
  • String
  • tb
  • 业务标识
  • └ priority
  • Number
  • 1
  • 优先级
  • └ description
  • String
  • 任务描述
  • 任务描述
  • └ finish_date
  • Date
  • 2020-01-14 14:39:51
  • 完成时间
  • └ start_date
  • Date
  • 2020-01-14 14:39:51
  • 开始时间
  • └ is_recycled
  • Boolean
  • false
  • 是否放入回收站
  • └ is_archived
  • Boolean
  • false
  • 是否归档
  • └ status_stage
  • Number
  • 1
  • 状态阶段: 开始阶段(0),进行阶段(1),完成阶段(2)
  • └ source_id
  • String
  • tb-1
  • 来源id
  • └ parent_id
  • String
  • 1
  • 父任务id
  • └ task_type_id
  • Number
  • 1
  • 任务类型id
  • └ status_id
  • Number
  • 1
  • 工作流状态id
  • └ executor_userid
  • String
  • 1
  • 执行者id
  • └ subject
  • String
  • 测试任务
  • 标题
  • └ gmt_modified
  • Date
  • 2020-01-14 14:39:51
  • 修改时间
  • └ corp_id
  • String
  • 测试项目
  • 任务所属项目(虚拟企业),基于项目空间的项目
  • └ belong_corp_id
  • String
  • org1
  • 归属企业id
  • └ task_type_category
  • String
  • req
  • 任务类型分类:// 任务 TASK("task"), // 需求 REQ("req"), // 缺陷 BUG("bug"), // 风险 RISK("risk"), // 工作项 WORKITEM("workitem")
  • └ task_id
  • String
  • 111
  • 任务id
  • └ plan_start_date
  • Date
  • 2020-01-14 14:39:51
  • 计划开始时间
  • └ plan_finish_date
  • Date
  • 2020-01-14 14:39:51
  • 计划完成时间
  • └ tracker_userids
  • String []
  • ["userid1","userid2","userid3"]
  • 任务参与者列表
  • extension
  • TaskExtension
  • {"key":"value"}
  • 任务的扩展字段
  • └ comment_count
  • String
  • 3
  • 评论数
  • └ file_path
  • String
  • http://xxx
  • 附件地址
  • └ other
  • String
  • {"key":"value"}
  • 用户可扩展的字段
  • └ source
  • String
  • tb
  • 任务source来源
errcode Number 0000 错误码
errmsg String 参数错误 错误描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/workspace/task/getbysourceid");
OapiWorkspaceTaskGetbysourceidRequest req = new OapiWorkspaceTaskGetbysourceidRequest();
req.setAgentId(1111L);
req.setSourceId("tb_1");
req.setSource("tb");
OapiWorkspaceTaskGetbysourceidResponse rsp = client.execute(req, access_token);
System.out.println(rsp.getBody());

响应示例

  • JSON示例
{
    "result":{
        "gmt_create":"2020-01-14 14:39:51",
        "modifier_userid":"1",
        "creator_userid":"1",
        "biz_tag":"tb",
        "priority":1,
        "description":"任务描述",
        "finish_date":"2020-01-14 14:39:51",
        "start_date":"2020-01-14 14:39:51",
        "is_recycled":false,
        "is_archived":false,
        "status_stage":1,
        "source_id":"tb-1",
        "parent_id":"1",
        "task_type_id":1,
        "status_id":1,
        "executor_userid":"1",
        "subject":"测试任务",
        "gmt_modified":"2020-01-14 14:39:51",
        "corp_id":"测试项目",
        "belong_corp_id":"org1",
        "task_type_category":"req",
        "task_id":"111",
        "plan_start_date":"2020-01-14 14:39:51",
        "plan_finish_date":"2020-01-14 14:39:51",
        "tracker_userids":{
            "string":[
                "[\"userid1\"",
                "\"userid2\"",
                "\"userid3\"]"
            ]
        },
        "extension":{
            "comment_count":"3",
            "file_path":"http:\/\/xxx",
            "other":"{\"key\":\"value\"}"
        },
        "source":"tb"
    },
    "errcode":0000,
    "errmsg":"参数错误"
}

异常示例

  • JSON示例
{
	"errcode":88,
	"errmsg":"ding talk error"
}

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部