跳转到内容

里程碑任务

任务是一项您必须完成的活动或工作,通常作为更大里程碑的一部分。

属性

id (长整型)
用于识别任务的唯一标识符

id (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

标题 (字符串)
任务标题

标题 (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

模板 (task_template)
指示用于创建此任务的模板

模板 (task_template)
指示用于创建此任务的模板

示例

{
  "template": {
    "name": "test-template",
    "id": "234567890123456"
  }
}

描述 (html)
包含有关任务的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

计划开始时间 (datetime)
任务计划开始的日期和时间

计划开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

计划结束时间 (datetime)
任务计划完成的日期和时间

计划结束时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

更多属性 全部展开

实际开始时间 (datetime)

任务实际开始的日期和时间

实际开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

actual_end_time (datetime)

任务实际完成的日期和时间

actual_end_time (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

email_before (长整型)

指示在计划开始前何时发送通知

email_before (长整型)
允许的值为 0 ,900000 ,1800000 ,2700000 ,3600000 ,7200000 ,21600000 ,43200000 ,86400000 ,172800000 ,604800000

示例

234759602834500

percentage_completion (整数)

指示任务的完成百分比进度

percentage_completion (整数)
被认为较小的数字

示例

39

additional_cost (双精度)

除任务实际成本外的费用

additional_cost (双精度)
这些数字可以包含小数

示例

23.08

estimated_effort_days (长整型)

预计完成任务所需的天数

estimated_effort_days (长整型)
被认为具有较大数值的数字位数。

示例

2347

estimated_effort_hours (长整型)

预计完成任务所需的小时数

estimated_effort_hours (长整型)
被认为具有较大数值的数字位数。

示例

239

estimated_effort_minutes (长整型)

预计完成任务所需的分钟数

estimated_effort_minutes (长整型)
被认为具有较大数值的数字位数。

示例

457

status (状态)

指示任务的进度等级

status (状态)
指示任务的进度

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

group (组)

与任务关联的组

group (组)
指示与任务关联的组

示例

{
  "group": {
    "name": "test-group",
    "id": "234567890123456"
  }
}

marked_group (组)

任务触发时要分配的组

marked_group (组)
指示任务触发时要分配的组

示例

{
  "marked_group": {
    "name": "test-marked_group",
    "id": "234567890123456"
  }
}

owner (用户)

指示工作日志的所有者

owner (用户)
指示分配给任务的用户

示例

{
  "owner": {
    "name": "test-owner",
    "id": "234567890123456"
  }
}

marked_technician (用户)

任务触发时要分配的技术员

marked_technician (用户)
指示任务触发时要分配的用户

示例

{
  "marked_technician": {
    "name": "test-marked_technician",
    "id": "234567890123456"
  }
}

priority (优先级)

定义任务的紧迫性或重要性 

priority (优先级)
指示任务的优先级等级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

task_type (任务类型)

用于对类似案件的任务进行分类

task_type (任务类型)
指示任务的类型

示例

{
  "task_type": {
    "name": "test-task_type",
    "id": "234567890123456"
  }
}

attachments (附件)

附加到任务的文件。任务最多可以附加10个文件。

attachments (附件)
指示附加到任务的文件。任务最多可附加10个文件

示例

{
  "attachments": {
    "name": "test-attachments",
    "id": "234567890123456"
  }
}

udf_fields (用户定义字段)

包含与任务相关的用户定义字段值

udf_fields (用户定义字段)
包含与任务相关的用户定义字段值

示例

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

module (字符串)read only

任务所属的模块

module (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

created_date (datetime)read only

任务创建的日期和时间

created_date (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

created_by (用户)read only

创建任务的用户姓名和ID,采用JSON格式

created_by (用户)
指示创建任务的用户,采用JSON格式

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

estimated_effort (长整型)read only

完成任务所需的预计工作量

estimated_effort (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

index (整数)read only

指示里程碑任务的顺序

index (整数)
被认为较小的数字

示例

39

deleted (布尔值)read only

指示任务是否被删除

deleted (布尔值)
布尔值,可取 true 或 false 两个值

overdue (布尔值)read only

指示任务是否已逾期

overdue (布尔值)
布尔值,可取 true 或 false 两个值

associated_entity (字符串)read only

与任务关联的实体

associated_entity (字符串)
associated_entity 的正则表达式为 “request | problem | change | project | milestone | request_template | project_template | milestone_template | release | change_template | release_template”

示例

Sample Content

project (项目)read only

任务将关联的项目实体。只有当任务关联到该项目时,才会提供项目信息。

project (项目)
任务将关联的项目实体。 

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

milestone (里程碑)read only

任务将关联的里程碑实体。只有当任务关联到该里程碑时,才会提供里程碑信息。

milestone (里程碑)
指示任务将关联的里程碑实体

添加里程碑任务

此操作帮助您添加里程碑任务。

必填字段:- title, template

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks

属性

id (长整型)
用于识别任务的唯一标识符

id (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

标题 (字符串)
任务标题

标题 (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

模板 (task_template)
指示用于创建此任务的模板

模板 (task_template)
指示用于创建此任务的模板

示例

{
  "template": {
    "name": "test-template",
    "id": "234567890123456"
  }
}

描述 (html)
包含有关任务的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

计划开始时间 (datetime)
任务计划开始的日期和时间

计划开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

计划结束时间 (datetime)
任务计划完成的日期和时间

计划结束时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

更多属性 全部展开

实际开始时间 (datetime)

任务实际开始的日期和时间

实际开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

actual_end_time (datetime)

任务实际完成的日期和时间

actual_end_time (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

email_before (长整型)

指示在计划开始前何时发送通知

email_before (长整型)
允许的值为 0 ,900000 ,1800000 ,2700000 ,3600000 ,7200000 ,21600000 ,43200000 ,86400000 ,172800000 ,604800000

示例

234759602834500

percentage_completion (整数)

指示任务的完成百分比进度

percentage_completion (整数)
被认为较小的数字

示例

39

additional_cost (双精度)

除任务实际成本外的费用

additional_cost (双精度)
这些数字可以包含小数

示例

23.08

estimated_effort_days (长整型)

预计完成任务所需的天数

estimated_effort_days (长整型)
被认为具有较大数值的数字位数。

示例

2347

estimated_effort_hours (长整型)

预计完成任务所需的小时数

estimated_effort_hours (长整型)
被认为具有较大数值的数字位数。

示例

239

estimated_effort_minutes (长整型)

预计完成任务所需的分钟数

estimated_effort_minutes (长整型)
被认为具有较大数值的数字位数。

示例

457

status (状态)

指示任务的进度等级

status (状态)
指示任务的进度

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

group (组)

与任务关联的组

group (组)
指示与任务关联的组

示例

{
  "group": {
    "name": "test-group",
    "id": "234567890123456"
  }
}

marked_group (组)

任务触发时要分配的组

marked_group (组)
指示任务触发时要分配的组

示例

{
  "marked_group": {
    "name": "test-marked_group",
    "id": "234567890123456"
  }
}

owner (用户)

指示工作日志的所有者

owner (用户)
指示分配给任务的用户

示例

{
  "owner": {
    "name": "test-owner",
    "id": "234567890123456"
  }
}

marked_technician (用户)

任务触发时要分配的技术员

marked_technician (用户)
指示任务触发时要分配的用户

示例

{
  "marked_technician": {
    "name": "test-marked_technician",
    "id": "234567890123456"
  }
}

priority (优先级)

定义任务的紧迫性或重要性 

priority (优先级)
指示任务的优先级等级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

task_type (任务类型)

用于对类似案件的任务进行分类

task_type (任务类型)
指示任务的类型

示例

{
  "task_type": {
    "name": "test-task_type",
    "id": "234567890123456"
  }
}

attachments (附件)

附加到任务的文件。任务最多可以附加10个文件。

attachments (附件)
指示附加到任务的文件。任务最多可附加10个文件

示例

{
  "attachments": {
    "name": "test-attachments",
    "id": "234567890123456"
  }
}

udf_fields (用户定义字段)

包含与任务相关的用户定义字段值

udf_fields (用户定义字段)
包含与任务相关的用户定义字段值

示例

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

module (字符串)read only

任务所属的模块

module (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

created_date (datetime)read only

任务创建的日期和时间

created_date (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

created_by (用户)read only

创建任务的用户姓名和ID,采用JSON格式

created_by (用户)
指示创建任务的用户,采用JSON格式

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

estimated_effort (长整型)read only

完成任务所需的预计工作量

estimated_effort (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

index (整数)read only

指示里程碑任务的顺序

index (整数)
被认为较小的数字

示例

39

deleted (布尔值)read only

指示任务是否被删除

deleted (布尔值)
布尔值,可取 true 或 false 两个值

overdue (布尔值)read only

指示任务是否已逾期

overdue (布尔值)
布尔值,可取 true 或 false 两个值

associated_entity (字符串)read only

与任务关联的实体

associated_entity (字符串)
associated_entity 的正则表达式为 “request | problem | change | project | milestone | request_template | project_template | milestone_template | release | change_template | release_template”

示例

Sample Content

project (项目)read only

任务将关联的项目实体。只有当任务关联到该项目时,才会提供项目信息。

project (项目)
任务将关联的项目实体。 

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

milestone (里程碑)read only

任务将关联的里程碑实体。只有当任务关联到该里程碑时,才会提供里程碑信息。

milestone (里程碑)
指示任务将关联的里程碑实体

$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "owner": {
      "name": "Lincoln",
      "id": "1871812265827162"
    },
    "priority": {
      "name": "High",
      "id": "2474460469828007"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1898428065971893"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "1822002620862973"
    },
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    }
  }
}''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "owner": {
      "name": "Lincoln",
      "id": "1871812265827162"
    },
    "priority": {
      "name": "High",
      "id": "2474460469828007"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1898428065971893"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "1822002620862973"
    },
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    }
  }
}';
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "owner": {
      "name": "Lincoln",
      "id": "1871812265827162"
    },
    "priority": {
      "name": "High",
      "id": "2474460469828007"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1898428065971893"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "1822002620862973"
    },
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    }
  }
}'
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "owner": {
      "name": "Lincoln",
      "id": "1871812265827162"
    },
    "priority": {
      "name": "High",
      "id": "2474460469828007"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1898428065971893"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "1822002620862973"
    },
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    }
  }
}''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "attachments": [],
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "project": {
      "project_code": "test-project_code",
      "id": "2206525788698287",
      "title": "Create SRS",
      "display_id": {
      "display_value": "PJT-173",
      "value": "173"
     }
    },
    "title": "Create SRS",
    "marked_technician": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "2443319112022586",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "overdue": false,
    "additional_cost": "100",
    "actual_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "id": "1504379411346066",
    "actual_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "owner": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "1871812265827162",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "associated_entity": "project",
    "module": "Milestone",
    "priority": {
      "color": "#ffffff",
      "name": "High",
      "id": "2474460469828007"
    },
    "created_by": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "1577080616582153",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "scheduled_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "display_value": "Nov 10, 2016 11:44 AM",
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    },
    "deleted": false,
    "milestone": {
      "id": "2132942495432990"
    },
    "estimated_effort": "22845",
    "created_date": {
      "display_value": "Nov 10, 2016 11:44 AM",
      "value": "1478758440000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "color": "#ffffff",
      "name": "Implementation",
      "id": "1898428065971893"
    },
    "scheduled_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "status": {
      "in_progress": false,
      "internal_name": "test-internal_name",
      "stop_timer": false,
      "color": "#ffffff",
      "name": "Open",
      "id": "1822002620862973"
    }
  },
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

编辑里程碑任务

此操作帮助您更新里程碑任务。

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}

属性

id (长整型)
用于识别任务的唯一标识符

id (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

标题 (字符串)
任务标题

标题 (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

模板 (task_template)
指示用于创建此任务的模板

模板 (task_template)
指示用于创建此任务的模板

示例

{
  "template": {
    "name": "test-template",
    "id": "234567890123456"
  }
}

描述 (html)
包含有关任务的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

计划开始时间 (datetime)
任务计划开始的日期和时间

计划开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

计划结束时间 (datetime)
任务计划完成的日期和时间

计划结束时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

更多属性 全部展开

实际开始时间 (datetime)

任务实际开始的日期和时间

实际开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

actual_end_time (datetime)

任务实际完成的日期和时间

actual_end_time (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

email_before (长整型)

指示在计划开始前何时发送通知

email_before (长整型)
允许的值为 0 ,900000 ,1800000 ,2700000 ,3600000 ,7200000 ,21600000 ,43200000 ,86400000 ,172800000 ,604800000

示例

234759602834500

percentage_completion (整数)

指示任务的完成百分比进度

percentage_completion (整数)
被认为较小的数字

示例

39

additional_cost (双精度)

除任务实际成本外的费用

additional_cost (双精度)
这些数字可以包含小数

示例

23.08

estimated_effort_days (长整型)

预计完成任务所需的天数

estimated_effort_days (长整型)
被认为具有较大数值的数字位数。

示例

2347

estimated_effort_hours (长整型)

预计完成任务所需的小时数

estimated_effort_hours (长整型)
被认为具有较大数值的数字位数。

示例

239

estimated_effort_minutes (长整型)

预计完成任务所需的分钟数

estimated_effort_minutes (长整型)
被认为具有较大数值的数字位数。

示例

457

status (状态)

指示任务的进度等级

status (状态)
指示任务的进度

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

group (组)

与任务关联的组

group (组)
指示与任务关联的组

示例

{
  "group": {
    "name": "test-group",
    "id": "234567890123456"
  }
}

marked_group (组)

任务触发时要分配的组

marked_group (组)
指示任务触发时要分配的组

示例

{
  "marked_group": {
    "name": "test-marked_group",
    "id": "234567890123456"
  }
}

owner (用户)

指示工作日志的所有者

owner (用户)
指示分配给任务的用户

示例

{
  "owner": {
    "name": "test-owner",
    "id": "234567890123456"
  }
}

marked_technician (用户)

任务触发时要分配的技术员

marked_technician (用户)
指示任务触发时要分配的用户

示例

{
  "marked_technician": {
    "name": "test-marked_technician",
    "id": "234567890123456"
  }
}

priority (优先级)

定义任务的紧迫性或重要性 

priority (优先级)
指示任务的优先级等级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

task_type (任务类型)

用于对类似案件的任务进行分类

task_type (任务类型)
指示任务的类型

示例

{
  "task_type": {
    "name": "test-task_type",
    "id": "234567890123456"
  }
}

attachments (附件)

附加到任务的文件。任务最多可以附加10个文件。

attachments (附件)
指示附加到任务的文件。任务最多可附加10个文件

示例

{
  "attachments": {
    "name": "test-attachments",
    "id": "234567890123456"
  }
}

udf_fields (用户定义字段)

包含与任务相关的用户定义字段值

udf_fields (用户定义字段)
包含与任务相关的用户定义字段值

示例

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

module (字符串)read only

任务所属的模块

module (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

created_date (datetime)read only

任务创建的日期和时间

created_date (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

created_by (用户)read only

创建任务的用户姓名和ID,采用JSON格式

created_by (用户)
指示创建任务的用户,采用JSON格式

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

estimated_effort (长整型)read only

完成任务所需的预计工作量

estimated_effort (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

index (整数)read only

指示里程碑任务的顺序

index (整数)
被认为较小的数字

示例

39

deleted (布尔值)read only

指示任务是否被删除

deleted (布尔值)
布尔值,可取 true 或 false 两个值

overdue (布尔值)read only

指示任务是否已逾期

overdue (布尔值)
布尔值,可取 true 或 false 两个值

associated_entity (字符串)read only

与任务关联的实体

associated_entity (字符串)
associated_entity 的正则表达式为 “request | problem | change | project | milestone | request_template | project_template | milestone_template | release | change_template | release_template”

示例

Sample Content

project (项目)read only

任务将关联的项目实体。只有当任务关联到该项目时,才会提供项目信息。

project (项目)
任务将关联的项目实体。 

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

milestone (里程碑)read only

任务将关联的里程碑实体。只有当任务关联到该里程碑时,才会提供里程碑信息。

milestone (里程碑)
指示任务将关联的里程碑实体

$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}\
      -X PUT\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
  "task": {
    "owner": {
      "name": "Lincoln",
      "id": "2301935913214789"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "priority": {
      "name": "High",
      "id": "2328502781662753"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1904788127933512"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "2028758908906679"
    }
  }
}''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "task": {
    "owner": {
      "name": "Lincoln",
      "id": "2301935913214789"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "priority": {
      "name": "High",
      "id": "2328502781662753"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1904788127933512"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "2028758908906679"
    }
  }
}';
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
  "task": {
    "owner": {
      "name": "Lincoln",
      "id": "2301935913214789"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "priority": {
      "name": "High",
      "id": "2328502781662753"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1904788127933512"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "2028758908906679"
    }
  }
}'
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "task": {
    "owner": {
      "name": "Lincoln",
      "id": "2301935913214789"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "title": "Create SRS",
    "priority": {
      "name": "High",
      "id": "2328502781662753"
    },
    "scheduled_end_time": {
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "additional_cost": "100",
    "actual_end_time": {
      "value": "1512974940000"
    },
    "actual_start_time": {
      "value": "1421988300000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "name": "Implementation",
      "id": "1904788127933512"
    },
    "scheduled_start_time": {
      "value": "1421988300000"
    },
    "status": {
      "name": "Open",
      "id": "2028758908906679"
    }
  }
}''''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "attachments": [],
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "project": {
      "project_code": "test-project_code",
      "id": "1835820918950914",
      "title": "Create SRS",
      "display_id": {
      "display_value": "PJT-173",
      "value": "173"
     }
    },
    "title": "Create SRS",
    "marked_technician": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "2020729935683450",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "overdue": false,
    "additional_cost": "100",
    "actual_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "id": "1850904131920933",
    "actual_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "owner": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "2301935913214789",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "associated_entity": "project",
    "module": "Milestone",
    "priority": {
      "color": "#ffffff",
      "name": "High",
      "id": "2328502781662753"
    },
    "created_by": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "2035980242195913",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "scheduled_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
    "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "display_value": "Nov 10, 2016 11:44 AM",
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    },
    "deleted": false,
    "milestone": {
      "id": "1965493380535100"
    },
    "created_date": {
      "display_value": "Nov 10, 2016 11:44 AM",
      "value": "1478758440000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "color": "#ffffff",
      "name": "Implementation",
      "id": "1904788127933512"
    },
    "scheduled_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "status": {
      "in_progress": false,
      "internal_name": "test-internal_name",
      "stop_timer": false,
      "color": "#ffffff",
      "name": "Open",
      "id": "2028758908906679"
    }
  },
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

获取里程碑任务

此操作帮助您获取里程碑任务。

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}

属性

id (长整型)
用于识别任务的唯一标识符

id (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

标题 (字符串)
任务标题

标题 (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

模板 (task_template)
指示用于创建此任务的模板

模板 (task_template)
指示用于创建此任务的模板

示例

{
  "template": {
    "name": "test-template",
    "id": "234567890123456"
  }
}

描述 (html)
包含有关任务的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

计划开始时间 (datetime)
任务计划开始的日期和时间

计划开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

计划结束时间 (datetime)
任务计划完成的日期和时间

计划结束时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

更多属性 全部展开

实际开始时间 (datetime)

任务实际开始的日期和时间

实际开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

actual_end_time (datetime)

任务实际完成的日期和时间

actual_end_time (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

email_before (长整型)

指示在计划开始前何时发送通知

email_before (长整型)
允许的值为 0 ,900000 ,1800000 ,2700000 ,3600000 ,7200000 ,21600000 ,43200000 ,86400000 ,172800000 ,604800000

示例

234759602834500

percentage_completion (整数)

指示任务的完成百分比进度

percentage_completion (整数)
被认为较小的数字

示例

39

additional_cost (双精度)

除任务实际成本外的费用

additional_cost (双精度)
这些数字可以包含小数

示例

23.08

estimated_effort_days (长整型)

预计完成任务所需的天数

estimated_effort_days (长整型)
被认为具有较大数值的数字位数。

示例

2347

estimated_effort_hours (长整型)

预计完成任务所需的小时数

estimated_effort_hours (长整型)
被认为具有较大数值的数字位数。

示例

239

estimated_effort_minutes (长整型)

预计完成任务所需的分钟数

estimated_effort_minutes (长整型)
被认为具有较大数值的数字位数。

示例

457

status (状态)

指示任务的进度等级

status (状态)
指示任务的进度

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

group (组)

与任务关联的组

group (组)
指示与任务关联的组

示例

{
  "group": {
    "name": "test-group",
    "id": "234567890123456"
  }
}

marked_group (组)

任务触发时要分配的组

marked_group (组)
指示任务触发时要分配的组

示例

{
  "marked_group": {
    "name": "test-marked_group",
    "id": "234567890123456"
  }
}

owner (用户)

指示工作日志的所有者

owner (用户)
指示分配给任务的用户

示例

{
  "owner": {
    "name": "test-owner",
    "id": "234567890123456"
  }
}

marked_technician (用户)

任务触发时要分配的技术员

marked_technician (用户)
指示任务触发时要分配的用户

示例

{
  "marked_technician": {
    "name": "test-marked_technician",
    "id": "234567890123456"
  }
}

priority (优先级)

定义任务的紧迫性或重要性 

priority (优先级)
指示任务的优先级等级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

task_type (任务类型)

用于对类似案件的任务进行分类

task_type (任务类型)
指示任务的类型

示例

{
  "task_type": {
    "name": "test-task_type",
    "id": "234567890123456"
  }
}

attachments (附件)

附加到任务的文件。任务最多可以附加10个文件。

attachments (附件)
指示附加到任务的文件。任务最多可附加10个文件

示例

{
  "attachments": {
    "name": "test-attachments",
    "id": "234567890123456"
  }
}

udf_fields (用户定义字段)

包含与任务相关的用户定义字段值

udf_fields (用户定义字段)
包含与任务相关的用户定义字段值

示例

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

module (字符串)read only

任务所属的模块

module (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

created_date (datetime)read only

任务创建的日期和时间

created_date (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

created_by (用户)read only

创建任务的用户姓名和ID,采用JSON格式

created_by (用户)
指示创建任务的用户,采用JSON格式

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

estimated_effort (长整型)read only

完成任务所需的预计工作量

estimated_effort (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

index (整数)read only

指示里程碑任务的顺序

index (整数)
被认为较小的数字

示例

39

deleted (布尔值)read only

指示任务是否被删除

deleted (布尔值)
布尔值,可取 true 或 false 两个值

overdue (布尔值)read only

指示任务是否已逾期

overdue (布尔值)
布尔值,可取 true 或 false 两个值

associated_entity (字符串)read only

与任务关联的实体

associated_entity (字符串)
associated_entity 的正则表达式为 “request | problem | change | project | milestone | request_template | project_template | milestone_template | release | change_template | release_template”

示例

Sample Content

project (项目)read only

任务将关联的项目实体。只有当任务关联到该项目时,才会提供项目信息。

project (项目)
任务将关联的项目实体。 

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

milestone (里程碑)read only

任务将关联的里程碑实体。只有当任务关联到该里程碑时,才会提供里程碑信息。

milestone (里程碑)
指示任务将关联的里程碑实体

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}\
      -X GET\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};          
response = invokeurl
[
    url: url
    type: GET
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}  
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "task": {
      "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
    "percentage_completion": "30",
    "estimated_effort_hours": "20",
    "attachments": [],
    "email_before": "3600000",
    "description": "The SRS must contain all the requirements for the feature",
    "project": {
      "project_code": "test-project_code",
      "id": "2264111658147478",
      "title": "Create SRS",
      "display_id": {
      "display_value": "PJT-173",
      "value": "173"
     }
    },
    "title": "Create SRS",
    "marked_technician": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "1535323003932447",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "overdue": false,
    "additional_cost": "100",
    "actual_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "id": "1812392449864730",
    "actual_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "owner": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "1769738715543843",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "associated_entity": "project",
    "module": "Milestone",
    "priority": {
      "color": "#ffffff",
      "name": "High",
      "id": "1609361103967137"
    },
    "created_by": {
      "email_id": "lincoln@zmail.com",
      "is_technician": false,
      "sms_mail": "linc123@xys_sms.co",
      "phone": "022-1234567890",
      "name": "Lincoln",
      "mobile": "1234567890",
      "id": "2277660139615760",
      "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
      "is_vip_user": false,
      "department": null
    },
    "scheduled_end_time": {
      "display_value": "Dec 11, 2017 12:19 PM",
      "value": "1512974940000"
    },
    "estimated_effort_minutes": "45",
     "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "display_value": "Nov 10, 2016 11:44 AM",
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    },
    "deleted": false,
    "milestone": {
      "id": "2211898409226666"
    },
    "estimated_effort": "22845",
    "created_date": {
      "display_value": "Nov 10, 2016 11:44 AM",
      "value": "1478758440000"
    },
    "estimated_effort_days": "15",
    "task_type": {
      "color": "#ffffff",
      "name": "Implementation",
      "id": "2193248305423023"
    },
    "scheduled_start_time": {
      "display_value": "Jan 23, 2015 10:15 AM",
      "value": "1421988300000"
    },
    "status": {
      "in_progress": false,
      "internal_name": "test-internal_name",
      "stop_timer": false,
      "color": "#ffffff",
      "name": "Open",
      "id": "1857239324475714"
    }
  },
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

获取里程碑任务列表

此操作帮助您获取所有里程碑任务。

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks

属性

id (长整型)
用于识别任务的唯一标识符

id (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

标题 (字符串)
任务标题

标题 (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

模板 (task_template)
指示用于创建此任务的模板

模板 (task_template)
指示用于创建此任务的模板

示例

{
  "template": {
    "name": "test-template",
    "id": "234567890123456"
  }
}

描述 (html)
包含有关任务的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

<b>The content to be displayed</b>

计划开始时间 (datetime)
任务计划开始的日期和时间

计划开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

计划结束时间 (datetime)
任务计划完成的日期和时间

计划结束时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

更多属性 全部展开

实际开始时间 (datetime)

任务实际开始的日期和时间

实际开始时间 (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

actual_end_time (datetime)

任务实际完成的日期和时间

actual_end_time (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

email_before (长整型)

指示在计划开始前何时发送通知

email_before (长整型)
允许的值为 0 ,900000 ,1800000 ,2700000 ,3600000 ,7200000 ,21600000 ,43200000 ,86400000 ,172800000 ,604800000

示例

234759602834500

percentage_completion (整数)

指示任务的完成百分比进度

percentage_completion (整数)
被认为较小的数字

示例

39

additional_cost (双精度)

除任务实际成本外的费用

additional_cost (双精度)
这些数字可以包含小数

示例

23.08

estimated_effort_days (长整型)

预计完成任务所需的天数

estimated_effort_days (长整型)
被认为具有较大数值的数字位数。

示例

2347

estimated_effort_hours (长整型)

预计完成任务所需的小时数

estimated_effort_hours (长整型)
被认为具有较大数值的数字位数。

示例

239

estimated_effort_minutes (长整型)

预计完成任务所需的分钟数

estimated_effort_minutes (长整型)
被认为具有较大数值的数字位数。

示例

457

status (状态)

指示任务的进度等级

status (状态)
指示任务的进度

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

group (组)

与任务关联的组

group (组)
指示与任务关联的组

示例

{
  "group": {
    "name": "test-group",
    "id": "234567890123456"
  }
}

marked_group (组)

任务触发时要分配的组

marked_group (组)
指示任务触发时要分配的组

示例

{
  "marked_group": {
    "name": "test-marked_group",
    "id": "234567890123456"
  }
}

owner (用户)

指示工作日志的所有者

owner (用户)
指示分配给任务的用户

示例

{
  "owner": {
    "name": "test-owner",
    "id": "234567890123456"
  }
}

marked_technician (用户)

任务触发时要分配的技术员

marked_technician (用户)
指示任务触发时要分配的用户

示例

{
  "marked_technician": {
    "name": "test-marked_technician",
    "id": "234567890123456"
  }
}

priority (优先级)

定义任务的紧迫性或重要性 

priority (优先级)
指示任务的优先级等级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

task_type (任务类型)

用于对类似案件的任务进行分类

task_type (任务类型)
指示任务的类型

示例

{
  "task_type": {
    "name": "test-task_type",
    "id": "234567890123456"
  }
}

attachments (附件)

附加到任务的文件。任务最多可以附加10个文件。

attachments (附件)
指示附加到任务的文件。任务最多可附加10个文件

示例

{
  "attachments": {
    "name": "test-attachments",
    "id": "234567890123456"
  }
}

udf_fields (用户定义字段)

包含与任务相关的用户定义字段值

udf_fields (用户定义字段)
包含与任务相关的用户定义字段值

示例

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

module (字符串)read only

任务所属的模块

module (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

created_date (datetime)read only

任务创建的日期和时间

created_date (datetime)
作为 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

created_by (用户)read only

创建任务的用户姓名和ID,采用JSON格式

created_by (用户)
指示创建任务的用户,采用JSON格式

示例

{
  "created_by": {
    "email_id": "andrews@zmail.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

estimated_effort (长整型)read only

完成任务所需的预计工作量

estimated_effort (长整型)
被认为具有较大数值的数字位数。

示例

234759602834500

index (整数)read only

指示里程碑任务的顺序

index (整数)
被认为较小的数字

示例

39

deleted (布尔值)read only

指示任务是否被删除

deleted (布尔值)
布尔值,可取 true 或 false 两个值

overdue (布尔值)read only

指示任务是否已逾期

overdue (布尔值)
布尔值,可取 true 或 false 两个值

associated_entity (字符串)read only

与任务关联的实体

associated_entity (字符串)
associated_entity 的正则表达式为 “request | problem | change | project | milestone | request_template | project_template | milestone_template | release | change_template | release_template”

示例

Sample Content

project (项目)read only

任务将关联的项目实体。只有当任务关联到该项目时,才会提供项目信息。

project (项目)
任务将关联的项目实体。 

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

milestone (里程碑)read only

任务将关联的里程碑实体。只有当任务关联到该里程碑时,才会提供里程碑信息。

milestone (里程碑)
指示任务将关联的里程碑实体

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks\
      -X GET\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      --data-urlencode input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data":input_data};           
response = invokeurl
[
    url: url
    type: GET
    parameters:params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{}'@
$data = @{ 'input_data' = $input_data}    
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''       
url += "?" + urlencode({"input_data":input_data})
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": [
    {
      "status_code": 2000,
      "status": "success"
    }
  ],
  "list_info": {
    "has_more_rows": false,
    "row_count": 1
  },
  "tasks": [
    {
        "template": {
      "inactive": false,
      "name": "Default Task",
      "id": "1822002620872075"
    },
      "percentage_completion": "30",
      "estimated_effort_hours": "20",
      "email_before": "3600000",
      "description": "The SRS must contain all the requirements for the feature",
      "project": {
        "project_code": "test-project_code",
        "id": "1979225958246685",
        "title": "Create SRS",
      "display_id": {
      "display_value": "PJT-173",
      "value": "173"
     }
      },
      "title": "Create SRS",
      "marked_technician": {
        "email_id": "lincoln@zmail.com",
        "is_technician": false,
        "sms_mail": "linc123@xys_sms.co",
        "phone": "022-1234567890",
        "name": "Lincoln",
        "mobile": "1234567890",
        "id": "2076667701496890",
        "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
        "is_vip_user": false,
        "department": null
      },
      "overdue": false,
      "additional_cost": "100",
      "actual_end_time": {
        "display_value": "Dec 11, 2017 12:19 PM",
        "value": "1512974940000"
      },
      "id": "2145983913783948",
      "actual_start_time": {
        "display_value": "Jan 23, 2015 10:15 AM",
        "value": "1421988300000"
      },
      "owner": {
        "email_id": "lincoln@zmail.com",
        "is_technician": false,
        "sms_mail": "linc123@xys_sms.co",
        "phone": "022-1234567890",
        "name": "Lincoln",
        "mobile": "1234567890",
        "id": "2419092744655162",
        "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
        "is_vip_user": false,
        "department": null
      },
      "associated_entity": "project",
      "module": "Milestone",
      "priority": {
        "color": "#ffffff",
        "name": "High",
        "id": "1481689150742475"
      },
      "created_by": {
        "email_id": "lincoln@zmail.com",
        "is_technician": false,
        "sms_mail": "linc123@xys_sms.co",
        "phone": "022-1234567890",
        "name": "Lincoln",
        "mobile": "1234567890",
        "id": "2334112382067270",
        "photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
        "is_vip_user": false,
        "department": null
      },
      "scheduled_end_time": {
        "display_value": "Dec 11, 2017 12:19 PM",
        "value": "1512974940000"
      },
      "estimated_effort_minutes": "45",
       "udf_fields": {
      "udf_long1": "1563389026964443",
      "udf_date1": {
        "display_value": "Nov 10, 2016 11:44 AM",
        "value": "1478758440000"
      },
      "udf_char1": "test-udf_char1"
    },
      "deleted": false,
      "milestone": {
        "id": "2319798696982459"
      },
      "estimated_effort": "22845",
      "created_date": {
        "display_value": "Nov 10, 2016 11:44 AM",
        "value": "1478758440000"
      },
      "estimated_effort_days": "15",
      "task_type": {
        "color": "#ffffff",
        "name": "Implementation",
        "id": "2069098922455543"
      },
      "scheduled_start_time": {
        "display_value": "Jan 23, 2015 10:15 AM",
        "value": "1421988300000"
      },
      "status": {
        "in_progress": false,
        "internal_name": "test-internal_name",
        "stop_timer": false,
        "color": "#ffffff",
        "name": "Open",
        "id": "2372589271608930"
      }
    }
  ]
}

删除里程碑任务

此操作帮助您删除里程碑任务。

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}

$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

向里程碑任务添加附件

此操作帮助您向里程碑任务添加附件。输入必须为 multipart - form 数据。必填字段:filename

必填字段:- filename

Url

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}/_uploads

属性

filename (文件)
上传文件的路径必须以’@’开头。

filename (文件)
上传文件的名称。

示例

test-document.txt

addtoattachment (布尔值)
表示是否将文件作为附件添加到关联实体。

addtoattachment (布尔值)
布尔值,可取两个可能值。

示例

True or False

files (文件集)
文件的详细信息包含在此处。
show attribute

files (文件集)
包含已上传文件的信息。

示例

{
  "size": "601",
  "content_type": "application/unknown-mime-type",
  "file_id": "6003",
  "name": "test-document.txt",
  "content_url": "<file path>"
  "id": "17322245500049868"
}

size (长整型)
上传文件的大小。

size (长整型)
被认为数值较大的数字

示例

234759602834500

content_type (字符串)
文件内容的类型。

content_type (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

file_id (长整型)
file_id 用于将该文件作为附件添加到实体

file_id (长整型)
被认为数值较大的数字

示例

234759602834500

name (字符串)
文件名称。

name (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

content_url (字符串)
上传文件的 URL。

content_url (字符串)
纯文本格式。不允许使用富文本或换行符。

示例

Sample Content

$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}/_uploads\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: multipart/form-data"\
      -F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}/_uploads";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "multipart/form-data",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};   
file_list.add(param1);                 
response = invokeurl
[
    url: url
    type: POST
    headers: headers
    files: file_list 
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}/_uploads"
$filePath = "local_file_path"                    
$addtoattachment = "true"

$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
    "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}

$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
    "--$boundary",
    "Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
    "$addtoattachment",
    "--$boundary",
    "Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
    "Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
    $content,
    "--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid

url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/tasks/{task_id}/_uploads"
file_path = "local_file_path"
add_to_attachments = "true"

boundary = uuid.uuid4()
headers = {
    "Content-Type": f"multipart/form-data; boundary={boundary}",
    "Accept": "application/vnd.manageengine.sdp.v3+json",
    "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
}

with open(file_path, "rb") as f:
    content = f.read()
body = (
    bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="addtoattachment"\r\n\r\n{add_to_attachments}\r\n', "utf-8")
    + bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="filename"; filename="{ntpath.basename(file_path)}"\r\nContent-Type: {mimetypes.guess_type(file_path)[0] or "application/octet-stream"}\r\n\r\n', "utf-8")
    + content
    + bytes(f"\r\n--{boundary}--", "utf-8")
)

httprequest = Request(url, data=body, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode("utf-8"))
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": [
    {
      "status_code": 2000,
      "status": "success"
    }
  ],
  "files": [
    {
      "content_type": "application/zip",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt",
      "content_url": "/projects/3421234312443133/milestones/3421234312443123/tasks/43234334341234564/_uploads/4001"
    }
  ]
}