创建IPD工作项
功能介绍
创建IPD项目工作项。
调用方法
请参见如何调用API。
URI
POST /v1/ipdprojectservice/projects/{project_id}/issues
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
参数解释: 项目的32位uuid,项目唯一标识,通过查询项目列表接口获取,响应消息体中的project_id字段的值就是项目ID。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
否 |
String |
参数解释: 用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。 约束限制: 必传。 取值范围: 最小长度:10,最大长度:32768。 默认取值: 不涉及。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
title |
是 |
String |
参数解释: 工作项标题。 约束限制: 正则表达式:[\s\S]{1,256}。 取值范围: 最大长度256位。 默认取值: 不涉及。 |
description |
是 |
String |
参数解释: 工作项描述字段。 约束限制: 正则表达式:[\s\S]{0,500000}。 取值范围: 最大字段长度:500000位。 默认取值: 不涉及。 |
status |
否 |
String |
参数解释: 工作项状态code。 约束限制: 正则表达式:([A-Z_][A-Za-z_]{2,20}|\S{18,32}|s\d{19,30})。 取值范围: Committed(保存); Analyse(分析); ToBeConfirmed(确认); Plan(规划); Doing(实现); Delivered(交付); Checking(验收)。 默认取值: 不涉及。 |
src_domain |
否 |
String |
参数解释: 提出项目的租户ID,通过获取当前用户信息接口查询用户对应的租户信息。 约束限制: 正则表达式,[A-Za-z0-9]{32}。 取值范围: 不涉及。 默认取值: 不涉及。 |
submitted_by |
否 |
String |
参数解释: 提交人Id。用户通过获取当前用户信息接口获取,响应消息体中的user_id字段的值就是用户32位uuid。 约束限制: 正则表达式:"[0-9a-z]{32}"。 取值范围: 不涉及。 默认取值: |
domain_id |
否 |
String |
参数解释: 归属项目的租户ID,通过获取当前用户信息接口查询用户对应的租户信息。 约束限制: 正则表达式,[A-Za-z0-9]{32}。 取值范围: 不涉及。 默认取值: 不涉及。 |
recipient |
否 |
Array of strings |
参数解释: 承接人id。用户通过获取当前用户信息接口获取,响应消息体中的user_id字段的值就是用户32位uuid。 约束限制: 正则表达式:"[0-9a-z]{32}"。 |
expect_delivery_time |
否 |
Long |
参数解释: 期望完成时间。 约束限制: 不涉及。 取值范围: 时间戳。 默认取值: 不涉及。 |
priority |
否 |
String |
参数解释: 优先级。用户通过查询字段列表接口获取,响应消息体中优先级的option字段的值就是密级字段的可选值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
assigned_cc |
否 |
Array of strings |
参数解释: 工作项抄送人,支持多个抄送人。 约束限制: 同一工作项最多支持50个抄送人。 |
category |
是 |
String |
参数解释: 工作项类型。编辑工作项时,此字段必填、值为当前工作项正确的工作项类型,但不会更新此字段。 约束限制: 正则表达式:[A-Z_]{2,20}。 取值范围: 系统设备类项目可选值为:RR、SF、IR、SR、AR、Task、Bug; 独立软件类项目可选值为:RR、SF、IR、US、Task、Bug; 云服务类项目可选值为:RR、Epic、FE、US、Task、Bug。 默认取值: |
assignee |
是 |
String |
参数解释: 工作项责任人。用户通过获取当前用户信息接口获取,响应消息体中的user_id字段的值就是用户32位uuid。 约束限制: 正则表达式:[A-Za-z0-9]{32}。 取值范围: 不涉及。 默认取值: 不涉及。 |
plan_pi |
否 |
String |
参数解释: 工作项发布计划Id。 约束限制: 默认SR、AR、US、Task、Bug有此字段。 取值范围: 不涉及。 默认取值: 不涉及。 |
plan_iteration |
否 |
String |
参数解释: 工作项完成的迭代计划id,可通过查询树状工作项接口获取,响应消息体中的plan_iteration字段的值就是迭代计划id。 约束限制: 正则表达式,^([0-9]{18,19})$。 取值范围: 不涉及。 默认取值: 不涉及。 |
plan_start_date |
否 |
Long |
参数解释: 工作项计划结束日期。 约束限制: 正则表达式:-?[0-9]{0,13}。 取值范围: 时间戳。 默认取值: 不涉及。 |
plan_end_date |
否 |
Long |
参数解释: 工作项计划结束日期。 约束限制: 正则表达式:-?[0-9]{0,13}。 取值范围: 时间戳。 默认取值: 不涉及。 |
workload_man_day |
否 |
Integer |
参数解释: 工作项计划工时。 约束限制: 正则表达式:([0-9]{1,8}([.][0-9])?)。 取值范围: 保留一位小数,取值范围为0~999999999.9。 默认取值: 不涉及。 |
business_domain |
否 |
String |
参数解释: 领域,可以通过查询字段列表接口获取,响应消息体中领域的option字段的值就是领域字段的可选值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
need_break |
否 |
String |
参数解释: 是否需要分解。可以通过查询字段列表接口获取,响应消息体中是否需要分解的option字段的值就是是否需要分解字段的可选值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
status |
String |
参数解释: 返回状态。 取值范围: success:响应成功 error:响应失败 |
message |
String |
参数解释: 信息 取值范围: 不涉及 |
result |
Array of IssueDetailsResponse objects |
参数解释: 查询结果 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 工作项ID。 取值范围: 不涉及。 |
number |
String |
参数解释: 工作项编号。 取值范围: 不涉及。 |
type |
String |
参数解释: 工作项类型。 取值范围: 不涉及。 |
stay_days |
Integer |
参数解释: 停留天数。 取值范围: 不涉及。 |
tenant_id |
String |
参数解释: 租户ID。 取值范围: 不涉及。 |
created_date |
String |
参数解释: 工作项创建时间。 取值范围: 不涉及。 |
title |
String |
参数解释: 工作项标题。 取值范围: 不涉及。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
参数解释: 密级字段id。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
display_value |
String |
参数解释: 密级字段名称。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
value |
String |
参数解释: 用户自定义的密级字段的值。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 value: |
code |
String |
参数解释: 密级编码。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
sequence |
Double |
参数解释: 密级排序值,越大级别越高 |
请求示例
-
/v1/ipdprojectservice/projects/{project_id}/issues { "status" : "Analyse", "title" : "模型一原始需求demo", "description" : "<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>", "src_domain" : "868551927720357888", "submitted_by" : "a360371833bf4c558f796fd707b44daf", "domain_id" : "868551927720357888", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "recipient" : [ "a360371833bf4c558f796fd707b44daf" ], "priority" : "中", "category" : "RR" }
-
/v1/ipdprojectservice/projects/{project_id}/issues { "title" : "模型二初始需求demo", "description" : "<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>", "domain_id" : "885117755981602818", "status" : "Start", "submitted_by" : "eab51c9c46f84d3aab838e1db6401232", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "priority" : "中", "plan_pi" : "885118532431159297", "plan_iteration" : "885118693565890561", "plan_start_date" : 1688918400000, "plan_end_date" : 1690214400000, "workload_man_day" : 10, "business_domain" : "software", "need_break" : "yes", "assigned_cc" : [ "eab51c9c46f84d3aab838e1db6401232" ], "category" : "IR" }
-
/v1/ipdprojectservice/projects/{project_id}/issues { "title" : "模型三任务demo", "description" : "<p>【任务背景】</p><p><br></p><p>【任务价值】</p><p><br></p><p>【任务详情】</p>", "domain_id" : "885119056444489729", "status" : "Start", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "priority" : "中", "assigned_cc" : [ "eab51c9c46f84d3aab838e1db6401232" ], "business_domain" : "software", "plan_start_date" : 1688918400000, "plan_end_date" : 1690214400000, "workload_man_day" : 12, "category" : "Task" }
响应示例
状态码:200
创建成功响应
{ "status" : "success", "message" : null, "result" : [ ] }
SDK代码示例
SDK代码示例如下。
Java
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.projectman.v4.region.ProjectManRegion; import com.huaweicloud.sdk.projectman.v4.*; import com.huaweicloud.sdk.projectman.v4.model.*; import java.util.List; import java.util.ArrayList; public class CreateIpdProjectIssueSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); ProjectManClient client = ProjectManClient.newBuilder() .withCredential(auth) .withRegion(ProjectManRegion.valueOf("<YOUR REGION>")) .build(); CreateIpdProjectIssueRequest request = new CreateIpdProjectIssueRequest(); request.withProjectId("{project_id}"); CreateIpdProjectIssueRequestBody body = new CreateIpdProjectIssueRequestBody(); List<String> listbodyRecipient = new ArrayList<>(); listbodyRecipient.add("a360371833bf4c558f796fd707b44daf"); body.withAssignee("eab51c9c46f84d3aab838e1db6401232"); body.withCategory("RR"); body.withPriority("中"); body.withRecipient(listbodyRecipient); body.withDomainId("868551927720357888"); body.withSubmittedBy("a360371833bf4c558f796fd707b44daf"); body.withSrcDomain("868551927720357888"); body.withStatus("Analyse"); body.withDescription("<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>"); body.withTitle("模型一原始需求demo"); request.withBody(body); try { CreateIpdProjectIssueResponse response = client.createIpdProjectIssue(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.projectman.v4.region.ProjectManRegion; import com.huaweicloud.sdk.projectman.v4.*; import com.huaweicloud.sdk.projectman.v4.model.*; import java.util.List; import java.util.ArrayList; public class CreateIpdProjectIssueSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); ProjectManClient client = ProjectManClient.newBuilder() .withCredential(auth) .withRegion(ProjectManRegion.valueOf("<YOUR REGION>")) .build(); CreateIpdProjectIssueRequest request = new CreateIpdProjectIssueRequest(); request.withProjectId("{project_id}"); CreateIpdProjectIssueRequestBody body = new CreateIpdProjectIssueRequestBody(); List<String> listbodyAssignedCc = new ArrayList<>(); listbodyAssignedCc.add("eab51c9c46f84d3aab838e1db6401232"); body.withNeedBreak("yes"); body.withBusinessDomain("software"); body.withWorkloadManDay(10); body.withPlanEndDate(1690214400000L); body.withPlanStartDate(1688918400000L); body.withPlanIteration("885118693565890561"); body.withPlanPi("885118532431159297"); body.withAssignee("eab51c9c46f84d3aab838e1db6401232"); body.withCategory("IR"); body.withAssignedCc(listbodyAssignedCc); body.withPriority("中"); body.withDomainId("885117755981602818"); body.withSubmittedBy("eab51c9c46f84d3aab838e1db6401232"); body.withStatus("Start"); body.withDescription("<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>"); body.withTitle("模型二初始需求demo"); request.withBody(body); try { CreateIpdProjectIssueResponse response = client.createIpdProjectIssue(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.projectman.v4.region.ProjectManRegion; import com.huaweicloud.sdk.projectman.v4.*; import com.huaweicloud.sdk.projectman.v4.model.*; import java.util.List; import java.util.ArrayList; public class CreateIpdProjectIssueSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); ProjectManClient client = ProjectManClient.newBuilder() .withCredential(auth) .withRegion(ProjectManRegion.valueOf("<YOUR REGION>")) .build(); CreateIpdProjectIssueRequest request = new CreateIpdProjectIssueRequest(); request.withProjectId("{project_id}"); CreateIpdProjectIssueRequestBody body = new CreateIpdProjectIssueRequestBody(); List<String> listbodyAssignedCc = new ArrayList<>(); listbodyAssignedCc.add("eab51c9c46f84d3aab838e1db6401232"); body.withBusinessDomain("software"); body.withWorkloadManDay(12); body.withPlanEndDate(1690214400000L); body.withPlanStartDate(1688918400000L); body.withAssignee("eab51c9c46f84d3aab838e1db6401232"); body.withCategory("Task"); body.withAssignedCc(listbodyAssignedCc); body.withPriority("中"); body.withDomainId("885119056444489729"); body.withStatus("Start"); body.withDescription("<p>【任务背景】</p><p><br></p><p>【任务价值】</p><p><br></p><p>【任务详情】</p>"); body.withTitle("模型三任务demo"); request.withBody(body); try { CreateIpdProjectIssueResponse response = client.createIpdProjectIssue(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
Python
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkprojectman.v4 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = ProjectManClient.new_builder() \ .with_credentials(credentials) \ .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \ .build() try: request = CreateIpdProjectIssueRequest() request.project_id = "{project_id}" listRecipientbody = [ "a360371833bf4c558f796fd707b44daf" ] request.body = CreateIpdProjectIssueRequestBody( assignee="eab51c9c46f84d3aab838e1db6401232", category="RR", priority="中", recipient=listRecipientbody, domain_id="868551927720357888", submitted_by="a360371833bf4c558f796fd707b44daf", src_domain="868551927720357888", status="Analyse", description="<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>", title="模型一原始需求demo" ) response = client.create_ipd_project_issue(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkprojectman.v4 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = ProjectManClient.new_builder() \ .with_credentials(credentials) \ .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \ .build() try: request = CreateIpdProjectIssueRequest() request.project_id = "{project_id}" listAssignedCcbody = [ "eab51c9c46f84d3aab838e1db6401232" ] request.body = CreateIpdProjectIssueRequestBody( need_break="yes", business_domain="software", workload_man_day=10, plan_end_date=1690214400000, plan_start_date=1688918400000, plan_iteration="885118693565890561", plan_pi="885118532431159297", assignee="eab51c9c46f84d3aab838e1db6401232", category="IR", assigned_cc=listAssignedCcbody, priority="中", domain_id="885117755981602818", submitted_by="eab51c9c46f84d3aab838e1db6401232", status="Start", description="<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>", title="模型二初始需求demo" ) response = client.create_ipd_project_issue(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkprojectman.v4 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] credentials = BasicCredentials(ak, sk) client = ProjectManClient.new_builder() \ .with_credentials(credentials) \ .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \ .build() try: request = CreateIpdProjectIssueRequest() request.project_id = "{project_id}" listAssignedCcbody = [ "eab51c9c46f84d3aab838e1db6401232" ] request.body = CreateIpdProjectIssueRequestBody( business_domain="software", workload_man_day=12, plan_end_date=1690214400000, plan_start_date=1688918400000, assignee="eab51c9c46f84d3aab838e1db6401232", category="Task", assigned_cc=listAssignedCcbody, priority="中", domain_id="885119056444489729", status="Start", description="<p>【任务背景】</p><p><br></p><p>【任务价值】</p><p><br></p><p>【任务详情】</p>", title="模型三任务demo" ) response = client.create_ipd_project_issue(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
Go
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := projectman.NewProjectManClient( projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listRecipientbody = []string{ "a360371833bf4c558f796fd707b44daf", } assigneeCreateIpdProjectIssueRequestBody:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueRequestBody:= "RR" priorityCreateIpdProjectIssueRequestBody:= "中" domainIdCreateIpdProjectIssueRequestBody:= "868551927720357888" submittedByCreateIpdProjectIssueRequestBody:= "a360371833bf4c558f796fd707b44daf" srcDomainCreateIpdProjectIssueRequestBody:= "868551927720357888" statusCreateIpdProjectIssueRequestBody:= "Analyse" descriptionCreateIpdProjectIssueRequestBody:= "<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>" titleCreateIpdProjectIssueRequestBody:= "模型一原始需求demo" request.Body = &model.CreateIpdProjectIssueRequestBody{ Assignee: &assigneeCreateIpdProjectIssueRequestBody, Category: &categoryCreateIpdProjectIssueRequestBody, Priority: &priorityCreateIpdProjectIssueRequestBody, Recipient: &listRecipientbody, DomainId: &domainIdCreateIpdProjectIssueRequestBody, SubmittedBy: &submittedByCreateIpdProjectIssueRequestBody, SrcDomain: &srcDomainCreateIpdProjectIssueRequestBody, Status: &statusCreateIpdProjectIssueRequestBody, Description: &descriptionCreateIpdProjectIssueRequestBody, Title: &titleCreateIpdProjectIssueRequestBody, } response, err := client.CreateIpdProjectIssue(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := projectman.NewProjectManClient( projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listAssignedCcbody = []string{ "eab51c9c46f84d3aab838e1db6401232", } needBreakCreateIpdProjectIssueRequestBody:= "yes" businessDomainCreateIpdProjectIssueRequestBody:= "software" workloadManDayCreateIpdProjectIssueRequestBody:= int32(10) planEndDateCreateIpdProjectIssueRequestBody:= int64(1690214400000) planStartDateCreateIpdProjectIssueRequestBody:= int64(1688918400000) planIterationCreateIpdProjectIssueRequestBody:= "885118693565890561" planPiCreateIpdProjectIssueRequestBody:= "885118532431159297" assigneeCreateIpdProjectIssueRequestBody:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueRequestBody:= "IR" priorityCreateIpdProjectIssueRequestBody:= "中" domainIdCreateIpdProjectIssueRequestBody:= "885117755981602818" submittedByCreateIpdProjectIssueRequestBody:= "eab51c9c46f84d3aab838e1db6401232" statusCreateIpdProjectIssueRequestBody:= "Start" descriptionCreateIpdProjectIssueRequestBody:= "<p>【需求背景】</p><p><br></p><p>【需求价值】</p><p><br></p><p>【需求详情】</p>" titleCreateIpdProjectIssueRequestBody:= "模型二初始需求demo" request.Body = &model.CreateIpdProjectIssueRequestBody{ NeedBreak: &needBreakCreateIpdProjectIssueRequestBody, BusinessDomain: &businessDomainCreateIpdProjectIssueRequestBody, WorkloadManDay: &workloadManDayCreateIpdProjectIssueRequestBody, PlanEndDate: &planEndDateCreateIpdProjectIssueRequestBody, PlanStartDate: &planStartDateCreateIpdProjectIssueRequestBody, PlanIteration: &planIterationCreateIpdProjectIssueRequestBody, PlanPi: &planPiCreateIpdProjectIssueRequestBody, Assignee: &assigneeCreateIpdProjectIssueRequestBody, Category: &categoryCreateIpdProjectIssueRequestBody, AssignedCc: &listAssignedCcbody, Priority: &priorityCreateIpdProjectIssueRequestBody, DomainId: &domainIdCreateIpdProjectIssueRequestBody, SubmittedBy: &submittedByCreateIpdProjectIssueRequestBody, Status: &statusCreateIpdProjectIssueRequestBody, Description: &descriptionCreateIpdProjectIssueRequestBody, Title: &titleCreateIpdProjectIssueRequestBody, } response, err := client.CreateIpdProjectIssue(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := projectman.NewProjectManClient( projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listAssignedCcbody = []string{ "eab51c9c46f84d3aab838e1db6401232", } businessDomainCreateIpdProjectIssueRequestBody:= "software" workloadManDayCreateIpdProjectIssueRequestBody:= int32(12) planEndDateCreateIpdProjectIssueRequestBody:= int64(1690214400000) planStartDateCreateIpdProjectIssueRequestBody:= int64(1688918400000) assigneeCreateIpdProjectIssueRequestBody:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueRequestBody:= "Task" priorityCreateIpdProjectIssueRequestBody:= "中" domainIdCreateIpdProjectIssueRequestBody:= "885119056444489729" statusCreateIpdProjectIssueRequestBody:= "Start" descriptionCreateIpdProjectIssueRequestBody:= "<p>【任务背景】</p><p><br></p><p>【任务价值】</p><p><br></p><p>【任务详情】</p>" titleCreateIpdProjectIssueRequestBody:= "模型三任务demo" request.Body = &model.CreateIpdProjectIssueRequestBody{ BusinessDomain: &businessDomainCreateIpdProjectIssueRequestBody, WorkloadManDay: &workloadManDayCreateIpdProjectIssueRequestBody, PlanEndDate: &planEndDateCreateIpdProjectIssueRequestBody, PlanStartDate: &planStartDateCreateIpdProjectIssueRequestBody, Assignee: &assigneeCreateIpdProjectIssueRequestBody, Category: &categoryCreateIpdProjectIssueRequestBody, AssignedCc: &listAssignedCcbody, Priority: &priorityCreateIpdProjectIssueRequestBody, DomainId: &domainIdCreateIpdProjectIssueRequestBody, Status: &statusCreateIpdProjectIssueRequestBody, Description: &descriptionCreateIpdProjectIssueRequestBody, Title: &titleCreateIpdProjectIssueRequestBody, } response, err := client.CreateIpdProjectIssue(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
创建成功响应 |
错误码
请参见错误码。