Creating an IPD Project Work Item
Function
This API is used to create an IPD project work item.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v1/ipdprojectservice/projects/{project_id}/issues
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition 32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID. Constraints N/A Range A string of 32 characters consisting of letters and digits. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range 10 to 32,768 characters Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| title | Yes | String | Definition Work item title. Constraints N/A Range 2 to 256 characters. Default Value N/A |
| description | Yes | String | Definition Work item description field. Constraints N/A Range 0 to 500,000 characters. Default Value N/A |
| status | No | String | Definition Work item status code. Obtain the value from the Querying the Work Item Status API. The value is code in the response body. Constraints N/A Range N/A Default Value N/A |
| src_domain | No | String | Definition ID of the project space of the work item's proposing project. Obtain the value by calling the Querying the IPD Project List API. The value of domain_id in the response message body is the project space ID. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| submitted_by | No | String | Definition Submitter ID. Obtain a user ID by calling the API for querying project members. The value of id in the response message body is a user ID. Constraints A string of 32 characters consisting of lowercase letters and digits. Range N/A Default Value |
| domain_id | No | String | Definition ID of the project space of the work item's responsible project. Obtain the value by calling the Querying the IPD Project List API. The value of domain_id in the response message body is the project space ID. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| recipient | No | Array of strings | Definition Recipient ID. Obtain a user ID by calling the API for querying project members. The value of id in the response message body is a user ID. Constraints A string of 32 characters consisting of lowercase letters and digits. |
| expect_delivery_time | No | Long | Definition Expected completion time. Constraints N/A Range Timestamp. Default Value N/A |
| priority | No | String | Definition Priority. You can obtain the value of this parameter using the Querying the Field List API. The value is the option field in the response message body. Constraints N/A Range Default Value N/A |
| assigned_cc | No | Array of strings | Definition Cc recipient ID of a work item. Multiple Cc recipients are supported. Constraints A work item can be copied to a maximum of 50 recipients. |
| category | Yes | String | Definition Work item type. This field is mandatory for work item editing. The value is the type of the current work item, which is not updated. Constraints N/A Range Multiple values are supported. Use commas (,) to separate them.
Default Value N/A |
| category_layer_id | No | String | Definition ID of the work item type hierarchy. This parameter affects the display of work item levels. Obtain the value from the API for obtaining the model tree configuration. Find the corresponding category_code in the category_layer_config of the response body based on the category parameter. The id at the same level as category_code is the work item type hierarchy ID. Constraints N/A Range N/A Default Value N/A |
| assignee | Yes | String | Definition Work item owner ID. Obtain a user ID by calling the API for querying project members. The value of id in the response message body is a user ID. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| plan_pi | No | String | Definition Work item release plan ID. You can query the plan list by calling the API for querying the release/sprint plan list. The id field of the object with category=PI in PlanVO in the returned parameters is the release plan ID. Constraints This field is available for SRs, ARs, USs, tasks, and bugs by default. Range N/A Default Value N/A |
| plan_iteration | No | String | Definition ID of the sprint plan in which the work item is completed. You can query the plan list by calling the API for querying the release/sprint plan list. The id field of the object with category=Iteration in PlanVO in the returned parameters is the sprint plan ID. Constraints A string of 18 to 19 digits. Range N/A Default Value N/A |
| plan_start_date | No | Long | Definition Planned end date of a work item. Constraints A string of 0 to 13 digits. The negative sign (-) can be used as the prefix. Range Timestamp. Default Value N/A |
| plan_end_date | No | Long | Definition Planned end date of a work item. Constraints A string of 0 to 13 digits. The negative sign (-) can be used as the prefix. Range Timestamp. Default Value N/A |
| workload_man_day | No | Integer | Definition Planned workloads of a work item. Constraints A string of 1 to 9 digits. The value can contain one decimal place. Range The value is a number with one decimal place. The value range is 0–999999999.9. Default Value N/A |
| business_domain | No | String | Definition Domain. You can obtain the value from the Querying the Field List API. The value is the option field in the response message body. Constraints N/A Range Default Value N/A |
| need_break | No | String | Definition Whether breakdown is required. You can obtain the value from the Querying the Field List API. The value is the option field of the desired field in the response message body. Constraints N/A Range Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Definition Response status. Range success: The response is successful. error: The response failed. |
| message | String | Definition Information. Range N/A |
| result | Array of IssueDetailsResponse objects | Definition Query result. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Work item ID. Range N/A |
| number | String | Definition Work item ID. Range N/A |
| type | String | Definition Work item type. Range N/A |
| stay_days | Integer | Definition Number of stay days. Range N/A |
| tenant_id | String | Definition Tenant ID. Range N/A |
| created_date | String | Definition Creation time of a work item. Range N/A |
| title | String | Definition Work item title. Range N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Definition Error code. Range N/A |
| error_msg | String | Definition Error description, which is a supplement to error_code. Range N/A |
Example Requests
-
POST https://{endpoint}/v1/ipdprojectservice/projects/de7115f62a96485b8ceaac6e68c701c4/issues { "status" : "Analyse", "title" : "Model 1 Raw Requirement Demo", "description" : "<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>", "src_domain" : "868551927720357888", "submitted_by" : "a360371833bf4c558f796fd707b44daf", "domain_id" : "868551927720357888", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "recipient" : [ "a360371833bf4c558f796fd707b44daf" ], "priority" : "Medium", "category" : "RR" } -
POST https://{endpoint}/v1/ipdprojectservice/projects/de7115f62a96485b8ceaac6e68c701c4/issues { "title" : "Model 2 Initial Requirement Demo", "description" : "<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>", "domain_id" : "885117755981602818", "status" : "Start", "submitted_by" : "eab51c9c46f84d3aab838e1db6401232", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "priority" : "Medium", "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" } -
POST https://{endpoint}/v1/ipdprojectservice/projects/de7115f62a96485b8ceaac6e68c701c4/issues { "title" : "Model 3 Task Demo", "description" : "<p>[Background] </p><p><br></p><p>[Value]</p><p><br></p><p>[Details]</p>", "domain_id" : "885119056444489729", "status" : "Start", "assignee" : "eab51c9c46f84d3aab838e1db6401232", "priority" : "Medium", "assigned_cc" : [ "eab51c9c46f84d3aab838e1db6401232" ], "business_domain" : "software", "plan_start_date" : 1688918400000, "plan_end_date" : 1690214400000, "workload_man_day" : 12, "category" : "Task" }
Example Responses
Status code: 200
{
"status" : "success",
"message" : "",
"result" : [ {
"domain_id" : "1273201979687350273",
"id" : "1281298264407584768",
"assignee" : "ee3ae960aa2247a2973eb34e4ea30f58",
"category" : "RR",
"created_by" : "029f95b680474fa396fcaba6a73954af",
"status" : "Plan"
} ],
"page" : null
} Status code: 400
{
"error_code" : "PM.02174103",
"error_msg" : "No permission."
} SDK Sample Code
The SDK sample code is as follows.
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}"); CreateIpdProjectIssueParam body = new CreateIpdProjectIssueParam(); List<String> listbodyRecipient = new ArrayList<>(); listbodyRecipient.add("a360371833bf4c558f796fd707b44daf"); body.withAssignee("eab51c9c46f84d3aab838e1db6401232"); body.withCategory("RR"); body.withPriority("Medium"); body.withRecipient(listbodyRecipient); body.withDomainId("868551927720357888"); body.withSubmittedBy("a360371833bf4c558f796fd707b44daf"); body.withSrcDomain("868551927720357888"); body.withStatus("Analyse"); body.withDescription("<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>"); body.withTitle("Model 1 Raw Requirement 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}"); CreateIpdProjectIssueParam body = new CreateIpdProjectIssueParam(); 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("Medium"); body.withDomainId("885117755981602818"); body.withSubmittedBy("eab51c9c46f84d3aab838e1db6401232"); body.withStatus("Start"); body.withDescription("<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>"); body.withTitle("Model 2 Initial Requirement 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}"); CreateIpdProjectIssueParam body = new CreateIpdProjectIssueParam(); 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("Medium"); body.withDomainId("885119056444489729"); body.withStatus("Start"); body.withDescription("<p>[Background] </p><p><br></p><p>[Value]</p><p><br></p><p>[Details]</p>"); body.withTitle("Model 3 Task 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 = CreateIpdProjectIssueParam( assignee="eab51c9c46f84d3aab838e1db6401232", category="RR", priority="Medium", recipient=listRecipientbody, domain_id="868551927720357888", submitted_by="a360371833bf4c558f796fd707b44daf", src_domain="868551927720357888", status="Analyse", description="<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>", title="Model 1 Raw Requirement 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 = CreateIpdProjectIssueParam( 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="Medium", domain_id="885117755981602818", submitted_by="eab51c9c46f84d3aab838e1db6401232", status="Start", description="<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>", title="Model 2 Initial Requirement 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 = CreateIpdProjectIssueParam( business_domain="software", workload_man_day=12, plan_end_date=1690214400000, plan_start_date=1688918400000, assignee="eab51c9c46f84d3aab838e1db6401232", category="Task", assigned_cc=listAssignedCcbody, priority="Medium", domain_id="885119056444489729", status="Start", description="<p>[Background] </p><p><br></p><p>[Value]</p><p><br></p><p>[Details]</p>", title="Model 3 Task 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 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, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := projectman.NewProjectManClient(hcClient) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listRecipientbody = []string{ "a360371833bf4c558f796fd707b44daf", } assigneeCreateIpdProjectIssueParam:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueParam:= "RR" priorityCreateIpdProjectIssueParam:= "Medium" domainIdCreateIpdProjectIssueParam:= "868551927720357888" submittedByCreateIpdProjectIssueParam:= "a360371833bf4c558f796fd707b44daf" srcDomainCreateIpdProjectIssueParam:= "868551927720357888" statusCreateIpdProjectIssueParam:= "Analyse" descriptionCreateIpdProjectIssueParam:= "<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>" titleCreateIpdProjectIssueParam:= "Model 1 Raw Requirement Demo" request.Body = &model.CreateIpdProjectIssueParam{ Assignee: &assigneeCreateIpdProjectIssueParam, Category: &categoryCreateIpdProjectIssueParam, Priority: &priorityCreateIpdProjectIssueParam, Recipient: &listRecipientbody, DomainId: &domainIdCreateIpdProjectIssueParam, SubmittedBy: &submittedByCreateIpdProjectIssueParam, SrcDomain: &srcDomainCreateIpdProjectIssueParam, Status: &statusCreateIpdProjectIssueParam, Description: &descriptionCreateIpdProjectIssueParam, Title: &titleCreateIpdProjectIssueParam, } 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 73 74 75 76 77 78 79 80 81 82 83 84
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, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := projectman.NewProjectManClient(hcClient) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listAssignedCcbody = []string{ "eab51c9c46f84d3aab838e1db6401232", } needBreakCreateIpdProjectIssueParam:= "yes" businessDomainCreateIpdProjectIssueParam:= "software" workloadManDayCreateIpdProjectIssueParam:= int32(10) planEndDateCreateIpdProjectIssueParam:= int64(1690214400000) planStartDateCreateIpdProjectIssueParam:= int64(1688918400000) planIterationCreateIpdProjectIssueParam:= "885118693565890561" planPiCreateIpdProjectIssueParam:= "885118532431159297" assigneeCreateIpdProjectIssueParam:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueParam:= "IR" priorityCreateIpdProjectIssueParam:= "Medium" domainIdCreateIpdProjectIssueParam:= "885117755981602818" submittedByCreateIpdProjectIssueParam:= "eab51c9c46f84d3aab838e1db6401232" statusCreateIpdProjectIssueParam:= "Start" descriptionCreateIpdProjectIssueParam:= "<p>[Background]</p><p><br></p>[Value]</p> <p><br></p><p>[Details]</p>" titleCreateIpdProjectIssueParam:= "Model 2 Initial Requirement Demo" request.Body = &model.CreateIpdProjectIssueParam{ NeedBreak: &needBreakCreateIpdProjectIssueParam, BusinessDomain: &businessDomainCreateIpdProjectIssueParam, WorkloadManDay: &workloadManDayCreateIpdProjectIssueParam, PlanEndDate: &planEndDateCreateIpdProjectIssueParam, PlanStartDate: &planStartDateCreateIpdProjectIssueParam, PlanIteration: &planIterationCreateIpdProjectIssueParam, PlanPi: &planPiCreateIpdProjectIssueParam, Assignee: &assigneeCreateIpdProjectIssueParam, Category: &categoryCreateIpdProjectIssueParam, AssignedCc: &listAssignedCcbody, Priority: &priorityCreateIpdProjectIssueParam, DomainId: &domainIdCreateIpdProjectIssueParam, SubmittedBy: &submittedByCreateIpdProjectIssueParam, Status: &statusCreateIpdProjectIssueParam, Description: &descriptionCreateIpdProjectIssueParam, Title: &titleCreateIpdProjectIssueParam, } 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 73 74 75 76
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, err := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). SafeBuild() if err != nil { fmt.Println(err) return } hcClient, err := projectman.ProjectManClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). SafeBuild() if err != nil { fmt.Println(err) return } client := projectman.NewProjectManClient(hcClient) request := &model.CreateIpdProjectIssueRequest{} request.ProjectId = "{project_id}" var listAssignedCcbody = []string{ "eab51c9c46f84d3aab838e1db6401232", } businessDomainCreateIpdProjectIssueParam:= "software" workloadManDayCreateIpdProjectIssueParam:= int32(12) planEndDateCreateIpdProjectIssueParam:= int64(1690214400000) planStartDateCreateIpdProjectIssueParam:= int64(1688918400000) assigneeCreateIpdProjectIssueParam:= "eab51c9c46f84d3aab838e1db6401232" categoryCreateIpdProjectIssueParam:= "Task" priorityCreateIpdProjectIssueParam:= "Medium" domainIdCreateIpdProjectIssueParam:= "885119056444489729" statusCreateIpdProjectIssueParam:= "Start" descriptionCreateIpdProjectIssueParam:= "<p>[Background] </p><p><br></p><p>[Value]</p><p><br></p><p>[Details]</p>" titleCreateIpdProjectIssueParam:= "Model 3 Task Demo" request.Body = &model.CreateIpdProjectIssueParam{ BusinessDomain: &businessDomainCreateIpdProjectIssueParam, WorkloadManDay: &workloadManDayCreateIpdProjectIssueParam, PlanEndDate: &planEndDateCreateIpdProjectIssueParam, PlanStartDate: &planStartDateCreateIpdProjectIssueParam, Assignee: &assigneeCreateIpdProjectIssueParam, Category: &categoryCreateIpdProjectIssueParam, AssignedCc: &listAssignedCcbody, Priority: &priorityCreateIpdProjectIssueParam, DomainId: &domainIdCreateIpdProjectIssueParam, Status: &statusCreateIpdProjectIssueParam, Description: &descriptionCreateIpdProjectIssueParam, Title: &titleCreateIpdProjectIssueParam, } response, err := client.CreateIpdProjectIssue(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
More
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
| Status Code | Description |
|---|---|
| 200 | Successful response for creating an RR |
| 400 | Response upon a request failure. For example, the user does not have the operation permission or the project does not exist. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot