全部产品

任务 API

更新时间:2020-08-31 11:15:21

创建任务

API:

CreateDevopsProjectTask

请求参数:

请求参数说明

该接口仅支持创建需求、任务、缺陷

参数

类型

是否必须

说明

OrgId

sting

企业id

ProjectId

string

项目 ID

ScenarioFieldConfigId

string

任务类型 ID,通过 获取scenariof ieldcofig接口获取

ExecutorId

string

执行者的用户 ID

TaskFlowStatusId

string

工作流状态 ID,通过 查询工作流状态信息接口获取

StartDate

string

开始日期

DueDate

string

截止日期

Note

string

任务备注

Priority

int

优先级:0:普通(默认值)1:紧急2:非常紧急

Visible

string

可见性:involves:任务参与者可见members:项目成员可见(默认值)

ParentTaskId

string

父任务 ID,传此参数相当于创建了一个子任务

SprintId

string

迭代id

Content

string

任务名称

TaskListId

string

任列列表id查看任务列表接口获取

{
    "successful": true,
    "errorCode": null,
    "errorMsg": null,
    "object": {
        "note": "",
        "_tasklistId": null,
        "isArchived": null,
        "tagIds": [],
        "dueDate": "2020-07-24T00:00:00.000Z",
        "rating": 0,
        "source": "teambition",
        "customfields": [],
        "content": "dddd",
        "_stageId": null,
        "_taskflowstatusId": "5f0acd6810e75b004a05f3c7",
        "taskType": null,
        "isDeleted": false,
        "accomplished": null,
        "_scenariofieldconfigId": "5f0acd6a57756a693b67d076",
        "pos": 0,
        "ancestorIds": [],
        "extra": {
            "reorder": false
        },
        "_creatorId": "5e9ee108424a50d98c7c8906",
        "isTopInProject": false,
        "visible": "members",
        "_executorId": null,
        "reminder": {
            "date": null,
            "members": [],
            "_creatorId": null,
            "rules": [],
            "type": "unset"
        },
        "storyPoint": null,
        "created": "2020-07-16T16:51:33.325Z",
        "_organizationId": null,
        "involveMembers": [],
        "priority": 0,
        "workTime": {
            "usedTime": 0,
            "unit": "minute",
            "totalTime": 0
        },
        "isDone": false,
        "labels": null,
        "recurrence": null,
        "badges": {
            "likesCount": 0,
            "attachmentsCount": 0,
            "objectlinksCount": 0,
            "commentsCount": 0
        },
        "progress": 0,
        "_appId": "5e706ed427331ce58b291e99",
        "_id": "5f108595eb2838e8f6553f96",
        "updated": "2020-07-16T16:51:33.325Z",
        "uniqueId": 38,
        "startDate": null,
        "_sprintId": "5f0acd6810e75b004a05f3de",
        "_projectId": "5f0acd6810e75b004a05f3a3"
    },
    "requestId": null,
}

返回参数说明

参数

说明

└ id

任务 ID

└ projectId

项目 ID

└ content

任务内容

└ executorId

执行者的用户 ID

└ taskflowstatusId

工作流状态 ID

└ startDate

开始时间

└ dueDate

截止时间

└ note

任务备注

└ priority

优先级:0:普通(默认值)1:紧急2:非常紧急

└ visible

可见性:involves:任务参与者可见members:项目成员可见(默认值)

└ customfields

自定义字段列表

└ cfId

自定义字段 ID

└ value

自定义字段的值

└ isDone

是否完成

└ creatorId

创建人的用户 ID

└ created

项目创建时间

└ modifierId

最近一次执行更新操作的用户 ID

└ updated

最近一次更新时间

示例代码:

        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        CreateDevopsProjectTaskRequest createProjectTaskRequest = new CreateDevopsProjectTaskRequest();
        createProjectTaskRequest.setSysEndpoint(endPoint);
        createProjectTaskRequest.setOrgId("<orgId>");
        createProjectTaskRequest.setProjectId("<projectId>");
        createProjectTaskRequest.setScenarioFieldConfigId("<scenarioFieldConfigId>");
        createProjectTaskRequest.setTaskFlowStatusId("<taskFlowStatusId>");
        createProjectTaskRequest.setContent("创建任务API-TEST");
        createProjectTaskRequest.setExecutorId("<executorId>");
        createProjectTaskRequest.setTaskListId("<taskListId>");


 

删除任务

API:

DeleteDevopsProjectTask

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

TaskId

string

任务 ID

{
    "Successful": true,
    "ErrorCode": null,
    "ErrorMsg": null,
    "Object": true,
    "RequestId": null
}

示例代码:

    
      String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String taskId = "111";
        DeleteDevopsProjectTaskResponse deleteProjectTaskResponse;
        // 删除任务
        deleteProjectTaskRequest.setOrgId("<orgId>");
        deleteProjectTaskRequest.setTaskId(taskId);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
        deleteProjectTaskRequest.setSysEndpoint(endPoint);
        deleteProjectTaskResponse = client.getAcsResponse(deleteProjectTaskRequest);
   
 

查看任务详情

API:

GetDevopsProjectTaskInfo

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

TaskId

string

任务 ID

{
    "Successful": true,
    "ErrorCode": null,
    "ErrorMsg": null,
    "Object": 
        {
        "TasklistId": "5d5798a2d4268209...",
      "ProjectId": "5e0d98527d161c00...",
      "TaskgroupId": "5d5798a2d4268209...",
      "Name": "列表1",
      "CreatorId": "5a28e2036176bbde...",
      "Created": "2019-12-01T10:30:00Z",
      "ModifierId": "5a28e2036176bbde...",
      "Updated": "2019-12-01T10:30:00Z"
        }
    ,
    "requestId": null
}

返回参数说明

参数

说明

└ taskId

任务 ID

└ projectId

项目 ID

└ templateId

任务类型 ID

└ tasklistId

任务列表 ID

└ taskgroupId

任务分组 ID

└ content

任务内容

└ executorId

执行者的用户 ID

└ statusId

工作流状态 ID

└ startDate

开始时间

└ dueDate

截止时间

└ note

任务备注

└ priority

优先级:0:普通(默认值)1:紧急2:非常紧急

└ visible

可见性:involves:任务参与者可见members:项目成员可见(默认值)

└ ancestorIds

所有祖先任务,ancestorIds[0] 为父任务,ancestorIds[1] 为父任务的父任务,以此类推

└ involveMembers

参与者的用户 ID 列表

└ customfields

自定义字段列表

└ cfId

自定义字段 ID

└ value

自定义字段的值

└ isDone

是否完成

└ creatorId

创建人的用户 ID

└ created

项目创建时间

└ modifierId

最近一次执行更新操作的用户 ID

└ updated

最近一次更新时间

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
       GetDevopsProjectTaskInfoRequest getProjectTaskInfoRequest = new GetDevopsProjectTaskInfoRequest();
        getProjectTaskInfoRequest.setSysEndpoint(endPoint);
        getProjectTaskInfoRequest.setOrgId("<orgId>");
        getProjectTaskInfoRequest.setTaskId(taskId);
        getProjectTaskInfoResponse = client.getAcsResponse(getProjectTaskInfoRequest);
 

修改任务

API:

UpdateDevopsProjectTask

请求参数:

请求参数说明

参数

类型

是否必须

说明

OrgId

string

企业id

ProjectId

string

项目 ID

ScenarioFieldConfigId

string

任务类型 ID,通过 获取scenariofieldcofig接口获取

ExecutorId

string

执行者的用户 ID

TaskFlowStatusId

string

工作流状态 ID,通过 查询工作流状态信息接口获取

StartDate

string

开始日期

DueDate

string

截止日期

Note

string

任务备注

Priority

int

优先级:0:普通(默认值)1:紧急2:非常紧急

Visible

string

可见性:involves:任务参与者可见members:项目成员可见(默认值)

ParentTaskId

string

父任务 ID,传此参数相当于创建了一个子任务

SprintId

string

迭代id

Content

string

任务名称

TaskId

string

任务id

{
    "Successful": true,
    "ErrorCode": null,
    "ErrorMsg": null,
    "Object": true,
    "RequestId": null
}


返回参数说明:

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
        UpdateDevopsProjectTaskRequest updateProjectTaskRequest = new UpdateDevopsProjectTaskRequest();
        updateProjectTaskRequest.setSysEndpoint(endPoint);
        updateProjectTaskRequest.setOrgId("<orgId>");
        updateProjectTaskRequest.setTaskId("<taskId>");
        updateProjectTaskRequest.setContent("修改任务");
        UpdateDevopsProjectTaskResponse updateProjectTaskResponse = client.getAcsResponse(updateProjectTaskRequest);
 

查看任务列表

API:

ListDevopsProjectTasks

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

projectIds

string

项目Id 多个逗号分割

{
    "Successful": true,
    "ErrorCode": null,
    "ErrorMsg": null,
    "Object": [
        {
        "TasklistId": "5d5798a2d4268209...",
      "ProjectId": "5e0d98527d161c00...",
      "TaskgroupId": "5d5798a2d4268209...",
      "Name": "列表1",
      "CreatorId": "5a28e2036176bbde...",
      "Created": "2019-12-01T10:30:00Z",
      "ModifierId": "5a28e2036176bbde...",
      "Updated": "2019-12-01T10:30:00Z"
        }]
    ,
    "requestId": null
}

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
        ListDevopsProjectTaskFlowRequest listProjectTaskFlowRequest = new ListDevopsProjectTaskFlowRequest();
        listProjectTaskFlowRequest.setSysEndpoint(endPoint);
        listProjectTaskFlowRequest.setOrgId("<orgId>");
        listProjectTaskFlowRequest.setProjectId("<projectId>");
        ListDevopsProjectTaskFlowResponse listProjectTaskFlowResponse = client.getAcsResponse(listProjectTaskFlowRequest);
     
 

查询工作流

API:

ListDevopsProjectTaskFlow

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

projectId

string

项目Id

{
"RequestId": "49EB85DB-6549-4370-A243-70B670FFFD38",
  "Object": [
    {
      "Type": "test",
      "Id": "5f4718052cd81600493d3bb5",
      "Name": "测试工作流"
    },
    {
      "Type": "defect",
      "Id": "5f4718052cd81600493d3bb6",
      "Name": "缺陷默认工作流"
    },
    {
      "Type": "task",
      "Id": "5f4718052cd81600493d3bb7",
      "Name": "任务默认工作流"
    },
    {
      "Type": "task",
      "Id": "5f4718052cd81600493d3bb8",
      "Name": "需求默认工作流"
    }
  ],
  "Successful": true
}

返回参数说明

参数

说明

└ id

taskflowStatusId ID

└ type

类型test 测试task 任务和需求defect 缺陷defult 默认

└ name

测试工作流、缺陷默认工作流、任务默认工作流、需求默认工作流

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
        ListDevopsProjectTaskFlowRequest listProjectTaskFlowRequest = new ListDevopsProjectTaskFlowRequest();
        listProjectTaskFlowRequest.setSysEndpoint(endPoint);
        listProjectTaskFlowRequest.setOrgId("<orgId>");
        listProjectTaskFlowRequest.setProjectId("<projectId>");
        ListDevopsProjectTaskFlowResponse listProjectTaskFlowResponse = client.getAcsResponse(listProjectTaskFlowRequest)
 

查询工作流状态

API:

ListDevopsProjectTaskFlowStatus

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

taskflowId

string

工作流id

{
    "Successful": true,
    "ErrorCode": null,
    "ErrorMsg": null,
    "Object": [
        {
            "IsDeleted": false,
            "rejectStatusIds": [],
            "pos": 163840,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.498Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "评审中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764c6",
            "updated": "2020-07-15T09:02:36.498Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 262144,
            "kind": "end",
            "created": "2020-07-15T09:02:36.498Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "已完成",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764c7",
            "updated": "2020-07-15T09:02:36.498Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 131072,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.498Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "开发中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764c8",
            "updated": "2020-07-15T09:02:36.498Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 196608,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.499Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "集成测试中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764c9",
            "updated": "2020-07-15T09:02:36.499Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 253952,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.499Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "发布中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764ca",
            "updated": "2020-07-15T09:02:36.499Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 229376,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.499Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "预发中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764cb",
            "updated": "2020-07-15T09:02:36.499Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 245760,
            "kind": "unset",
            "created": "2020-07-15T09:02:36.500Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "灰度中",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764cc",
            "updated": "2020-07-15T09:02:36.500Z"
        },
        {
            "isDeleted": false,
            "rejectStatusIds": [],
            "pos": 65536,
            "kind": "start",
            "created": "2020-07-15T09:02:36.500Z",
            "_taskflowId": "5f0ec62cccd91500486764c0",
            "name": "待处理",
            "_creatorId": "5e9ee108424a50d98c7c8906",
            "_id": "5f0ec62cccd91500486764cd",
            "updated": "2020-07-15T09:02:36.500Z"
        }
    ],
    "RequestId": null
}

返回参数说明

参数

说明

└ Name

状态名称

└ kind

状态类型:start:开始状态inProgress:进行中状态end:结束状态

└ pos

状态在工作流中的前后顺序

└ creatorId

创建人的用户 ID

└ created

项目创建时间

└ modifierId

最近一次执行更新操作的用户 ID

└ updated

最近一次更新时间

└ Id

taskflowStatusId

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         ListDevopsProjectTaskFlowStatusRequest listProjectTaskFlowStatusRequest = new ListDevopsProjectTaskFlowStatusRequest();
        listProjectTaskFlowStatusRequest.setSysEndpoint(endPoint);
        listProjectTaskFlowStatusRequest.setOrgId("<orgId>");
        listProjectTaskFlowStatusRequest.setTaskFlowId("<projectId>");
        ListDevopsProjectTaskFlowStatusResponse listProjectTaskFlowStatusResponse = client.getAcsResponse(listProjectTaskFlowStatusRequest);
 
 

获取 scenariofieldconfigId

API:

ListDevopsScenarioFieldConfig

请求参数:

参数

类型

是否必须

说明

OrgId

string

企业Id

projectId

string

项目id

{
    "successful": true,
    "errorCode": null,
    "errorMsg": null,
    "object": [
        {
            "id": "5f0acd6a57756a693b67d059",
            "type": "event"
        },
        {
            "id": "5f0acd6a57756a693b67d05f",
            "type": "testcase"
        },
        {
            "id": "5f0acd6a57756a693b67d066",
            "type": "story"
        },
        {
            "id": "5f0acd6a57756a693b67d070",
            "type": "defect"
        },
        {
            "id": "5f0acd6a57756a693b67d076",
            "type": "task"
        }
    ],
    "requestId": null
}

返回参数说明

参数

说明

└ type

task 任务defect 缺陷story 需求testcase 测试用例event 日程

└ Id

scenariofieldconfigId

示例代码:

         String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         DefaultProfile profile = DefaultProfile.getProfile(
            "cn-hangzhou",          // 地域ID
            "<ak>",      
            "<sk>");    
        IAcsClient client = new DefaultAcsClient(profile);
        String endPoint = "api-devops.cn-hangzhou.aliyuncs.com";
         ListDevopsScenarioFieldConfigRequest listScenarioFieldConfigRequest = new ListDevopsScenarioFieldConfigRequest();
        listScenarioFieldConfigRequest.setSysEndpoint(endPoint);
        listScenarioFieldConfigRequest.setOrgId("<orgId>");
        listScenarioFieldConfigRequest.setProjectId("<projectId>");
        ListDevopsScenarioFieldConfigResponse listScenarioFieldConfigResponse = client.getAcsResponse(listScenarioFieldConfigRequest);