Creating a BR/GR
Function
This API is used to create a baseline review (BR) or general review (GR).
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}/process-instances
| 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 |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| operate_type | No | String | Operation type. |
| domain_id | No | String | Domain ID of the proposing project. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| title | Yes | String | Title. |
| description | Yes | String | Description. |
| category | Yes | String | Type. |
| need_approval | No | Boolean | Whether the review needs to be approved by the decision-maker. |
| plan_end_date | No | String | Planned completion date (timestamp). It cannot be earlier than the planned start date. |
| plan_start_date | No | String | Planned start date (timestamp). It cannot be later than the planned completion date. |
| status | Yes | String | Status. |
| cc | No | Array of strings | Cc recipient list. |
| attachWikis | No | Array of strings | Associated wikis. |
| attachDocuments | No | Array of strings | Associated files. |
| ccbs | No | Array of ccbs objects | Decision-maker. |
| opinions | No | Array of opinions objects | Review expert. |
| cos | No | Array of cos objects | Review object. |
| local_attachment_names | No | Array of strings | Associated file name. |
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 | Response message. |
| result | result object | Returned result. |
| Parameter | Type | Description |
|---|---|---|
| cc | String | Cc recipient list. |
| approver | String | Decision-maker ID. |
| description | String | Review description. The list API does not return the description. |
| closed_time | String | Review completion time. |
| reviewer | String | Reviewer ID, separated by commas (,). |
| type | String | Type. |
| title | String | Review title. |
| modified_date | String | Timestamp when a review is last modified. |
| created_by | created_by object | Review creator. |
| domain_id | String | Tenant ID. |
| number | String | Review No. |
| need_approval | Boolean | Whether approval is required. |
| br2co | String | Baseline review object. |
| modified_by | modified_by object | Last modifier of a review. |
| approval_time | String | Review time. |
| plan_end_date | String | Planned completion time. |
| id | String | Review ID. |
| state | String | Review status. The options are In use and Discarded. |
| created_date | String | Creation time. |
| category | String | Type. |
| plan_start_date | String | Planned start time. |
| review_config | review_config object | Review configuration. |
| status | status object | Review status. |
| stage | String | Phase. |
| opinions | Array of opinions objects | List of change object review expert IDs (used when a change review is created). |
| opinion_comments | Array of strings | Review comments. |
| attachments | Array of strings | Attachment. |
| wikis | Array of strings | Associated wikis. |
| associatedocuments | Array of strings | Associated documents. |
| cos | Array of cos objects | Review object list. |
| approval_phase_result | String | Review result. |
| ccbs | Array of ccbs objects | Approval information list. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | User alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar. |
| region | String | Region. |
| opinion | String | Comments. |
| description | String | Description. |
| owner | String | Owner |
| ccbId | String | Review ID. |
| has_removed | String | Whether the user has been removed from the project. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | User alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar. |
| region | String | Region. |
| opinion | String | Comments. |
| description | String | Description. |
| owner | String | Owner |
| ccbId | String | Review ID. |
| has_removed | String | Whether the user is removed from the project. |
| Parameter | Type | Description |
|---|---|---|
| approval_type | Integer | Review type. |
| ratio_value | String | Approval progress. |
| skip_decisioning | Boolean | Whether to skip decision-making. |
| approval_roles | String | Decision-making role. |
| review_roles | String | Approval role. |
| Parameter | Type | Description |
|---|---|---|
| id | String | id |
| type | String | Type. |
| state | String | Status. |
| status | String | Status |
| region | String | Region |
| category | String | Type |
| title | String | Title. |
| rounds | String | Scope. |
| opinion | String | Observer. |
| description | String | Description. |
| modified_by | String | Modifier. |
| modified_date | String | Modification time. |
| created_by | created_by object | Creator. |
| created_date | String | Creation time. |
| tenant_id | String | Tenant ID. |
| domain_id | String | Project ID. |
| issue_category | String | Work item type. |
| issue_id | String | Work item ID. |
| curr_owner | curr_owner object | Current owner. |
| co_id | String | Change object ID. |
| user_id | String | User ID. |
| opinion_issue_id | String | Review work item ID. |
| opinion_issue_category | String | Review work item type. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | Alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar. |
| region | String | Region. |
| opinion | String | Comments. |
| description | String | Description. |
| owner | String | Owner. |
| ccbId | String | Review ID. |
| has_removed | String | Whether the user is removed from the project. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | Alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar. |
| region | String | Region. |
| opinion | String | Comments. |
| description | String | Description. |
| owner | String | Owner. |
| ccbId | String | Review ID. |
| has_removed | String | Whether the user is removed from the project. |
| Parameter | Type | Description |
|---|---|---|
| region | String | Region. |
| category | String | Work item type of the change object. The value is fixed to CO. |
| title | String | Review title. |
| status | String | Change object status. |
| assignee | assignee object | Cc recipient of a review. |
| description | String | Review description. |
| number | String | ID of the work item associated with the change object. |
| order | String | Sorting order. |
| co2cr | String | Associated change review flag. |
| co2br | String | Associated baseline review flag. |
| co2gr | String | Associated general review flag. |
| id | String | Approval object ID. |
| type | String | Review type. |
| state | String | Review status. The options are In use and Discarded. |
| before_change | String | Work item content before change. |
| after_change | String | Change object content after modification. |
| modified_by | String | Last modifier of a review. |
| modified_date | String | Last modification time of a review. |
| created_by | String | Review creator. |
| created_date | String | Review creation time. |
| tenant_id | String | ID of the tenant to which the work item belongs. Obtain the value from the Querying Tree-shaped Work Items API. The value is tenant_id in the response body. |
| status_map | String | Work item status. |
| domain_id | String | Tenant ID. |
| source_system | String | Source system. |
| source_system_link | String | Source system link. |
| issue_category | String | Type of the work item associated with the change object. |
| issue_id | String | Work item ID. |
| issue_status | issue_status object | Work item status. |
| issue_severity | String | Work item severity. |
| issue_priority | issue_priority object | Work item priority. |
| domain_title | String | Project name. |
| src_domain_title | String | Proposing project name. |
| issue_assignee_name | String | Owner alias. |
| change_reason | String | Review reason. |
| change_type | String | Review type. |
| source_system_id | String | Source system ID. |
| change_description | String | Review description. |
| has_deleted | String | Deleted or not. |
| approval_phase_result | String | Review result. |
| approval_complete_time | String | Review completion time. |
| ccb_description | String | Review description. |
| actual_ccb | String | Review expert. |
| ccbs | String | Approval information list. |
| ccb_info | String | Review information. |
| opinions | String | List of change object review expert IDs (used when a change review is created). |
| opinion_comments | String | Review comments. |
| approval_time | String | Approval time. |
| src_domain_id | String | Tenant ID. |
| cross_domain | String | Cross-tenant or not. |
| domain_moved | String | Whether the project is migrated. |
| reviewer | Array of strings | Review expert. |
| approver | Array of strings | Decision-maker. |
| rounds | String | Rounds of reviews. |
| last_round_result | String | Result of the latest round of decision-making. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | User alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar. |
| region | String | Region. |
| opinion | String | Review information. |
| description | String | Description. |
| owner | String | Current handler. |
| ccbId | String | Review object ID. |
| has_removed | String | Whether the user has been removed from the project. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Status ID. |
| belonging | String | Definition Work item status. Range START, IN_PROGRESS, and END |
| space_id | String | Space ID. |
| name | String | Status name. |
| code | String | Status code. |
| definition_type | String | Definition type. |
| belong_definition_type | Integer | Field definition type. |
| display_value | String | Display value. |
| position | Integer | Sorting position. |
| displayable | Integer | Displayable or not. |
| editable | Integer | Editable or not. |
| deletable | Integer | Deletable or not. |
| mutable | Integer | Changeable or not. |
| title_py | String | Status name abbreviation. |
| created_by | String | Status creator. |
| created_date | String | Status creation time. |
| modified_date | String | Latest modification time of a status. |
| modified_by | String | Last modifier of a status. |
| linkage_node_fields | Boolean | Whether to link the node field. |
| Parameter | Type | Description |
|---|---|---|
| id | String | id |
| display_value | String | Display name. |
| value | String | Value. |
| code | String | Code. |
| value_py | String | Value (initial letters) |
| sequence | Integer | Sequence. |
| level | Integer | Level. |
| domain_id | String | Project ID. |
| belong_definition_type | String | Definition severity. |
| Parameter | Type | Description |
|---|---|---|
| watcher | String | Observer. |
| user_id | String | User ID. |
| user_num_id | String | Digital ID of a user. |
| user_name | String | Username. |
| domain_id | String | Tenant ID. |
| domain_name | String | Tenant name. |
| nick_name | String | User alias. |
| role_id | String | Role ID. |
| role_name | String | Role name. |
| image_id | String | User avatar ID. |
| region | String | Region. |
| opinion | String | Review information. |
| description | String | Description. |
| owner | String | Current handler. |
| ccbId | String | Review object ID. |
| has_removed | String | The user has been removed from the project. |
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
Creating a BR
POST https://{endpoint}/v1/ipdprojectservice/projects/{project_id}/process-instances
{
"title" : "BR",
"description" : "<p><strong>[Background]</strong></p><p><br></p><p><strong>[Benefits]</strong></p><p><br></p><p><strong>[Details]</strong></p><br>",
"category" : "BR",
"need_approval" : true,
"status" : "ToBeReviewed",
"cc" : [ ],
"attachWikis" : [ ],
"attachDocuments" : [ ],
"ccbs" : [ {
"user_id" : "09d25f5d3f80d2881fd7c008ecf1622b"
} ],
"opinions" : [ {
"user_id" : "09d25f5d3f80d2881fd7c008ecf1622b",
"curr_owner" : "09d25f5d3f80d2881fd7c008ecf1622b"
} ],
"cos" : [ {
"number" : "IR20250716625228",
"issue_id" : "1152322333787987968",
"issue_category" : "IR",
"change_type" : "Modify",
"before_change" : "{\"view\":{}}",
"after_change" : "{\"view\":{},\"execute\":{}}"
} ],
"local_attachment_names" : [ ]
} Example Responses
Status code: 200
{
"status" : "success",
"result" : {
"id" : "1073568012549795840",
"number" : "CR20241211782294",
"state" : "In use",
"title" : "21-CR-10x",
"category" : "CR",
"created_by" : {
"id" : "a360371833bf4c558f796fd707b44daf",
"name" : "devcloud_devcloud_01",
"nick_name" : "Test account"
},
"modified_by" : {
"id" : "a360371833bf4c558f796fd707b44daf",
"name" : "devcloud_devcloud_01",
"nick_name" : "Test account"
},
"created_time" : "1733888160000",
"modified_time" : "1733888160000",
"plan_end_date" : "1735574400000",
"plan_start_date" : "1733673600000",
"need_approval" : "true",
"status" : {
"display_value" : "Pending review",
"code" : "ToBeReviewed"
},
"description" : "<p><strong>[Background]</strong></p><p>1</p><p><strong>[Benefits]</strong></p><p><br></p><p><strong>[Details]</strong></p>",
"cos" : [ {
"after_change" : "{\"view\":{\"description\":\"<p>[Fault Symptom]</p><p>x</p><p>[Environment Information]</p><p><br></p><p>[Onsite Fault Locating R&D Engineer]</p><p><br></p><p>[Preliminary Fault Locating]</p>\"},\"execute\":{\"description\":\"<p>[Fault Symptom]</p><p>x</p><p>[Environment Information]</p><p><br></p><p>[Onsite Fault Locating R&D Engineer]</p><p><br></p><p>[Preliminary Fault Locating]</p>\"},\"snapshot\":{\"found_iteration\":null,\"type\":\"bug\",\"test_failures_times\":\"0\",\"number\":\"BUG20241209780441\",\"convolution_actual_hours\":null,\"path\":\"/1072968362439385089\",\"workload_man_day\":null,\"id\":\"1072968362439385089\",\"state\":\"Working\",\"sys_no_repair_reason\":null,\"module\":null,\"priority\":null,\"found_env\":null,\"sys_activation_reason\":null,\"assignee\":{\"watcher\":0,\"user_id\":\"a360371833bf4c558f796fd707b44daf\",\"user_num_id\":4091,\"user_name\":\"devcloud_devcloud_01\",\"domain_id\":\"4e919d73499648e3b0292cd3cbef806a\",\"domain_name\":\"devcloud_devcloud_01\",\"nick_name\":\"Test account\",\"role_id\":\"257bbf34272649dd909bb35dfe27d126,05d9444b66cc4d5090ef3180a3096c91\",\"role_name\":\"Project manager,Project admin\",\"role_alias_name\":\"Project manager,Project admin\",\"role_code\":\"Project manager,project_admin\",\"image_id\":\"\",\"region\":\"\",\"has_removed\":\"\"},\"close_type\":null,\"status\":{\"id\":\"1072203303913304105\",\"belonging\":\"START\",\"space_id\":\"1072203303493873664\",\"name\":\"Analyzing\",\"status_category\":\"\",\"code\":\"Analyse\",\"definition_type\":\"5\",\"belong_definition_type\":3,\"belong_scope\":\"\",\"display_value\":\"Analyzing\",\"position\":2,\"displayable\":1,\"editable\":1,\"deletable\":1,\"mutable\":1,\"title_py\":\"fx\",\"builtin\":false,\"label\":\"\",\"description\":\"\",\"created_by\":\"a360371833bf4c558f796fd707b44daf\",\"created_userinfo\":null,\"created_on\":\"\",\"created_date\":1733591588000,\"modified_date\":1733591588000,\"modified_by\":\"a360371833bf4c558f796fd707b44daf\",\"category_code\":[],\"editing_fields\":[],\"associate\":null,\"linkage_node_fields\":false},\"tenant_id\":\"4e919d73499648e3b0292cd3cbef806a\",\"plan_pi\":null,\"repair_solution\":null,\"plan_end_date\":null,\"expected_repair_date\":null,\"plan_iteration\":null,\"cascade_delete\":\"none\",\"issue_opinion_id\":null,\"modified_by\":{\"watcher\":0,\"user_id\":\"a360371833bf4c558f796fd707b44daf\",\"user_num_id\":4091,\"user_name\":\"devcloud_devcloud_01\",\"domain_id\":\"4e919d73499648e3b0292cd3cbef806a\",\"domain_name\":\"devcloud_devcloud_01\",\"nick_name\":\"Test account\",\"role_id\":\"257bbf34272649dd909bb35dfe27d126,05d9444b66cc4d5090ef3180a3096c91\",\"role_name\":\"Project manager,Project admin\",\"role_alias_name\":\"Project manager,Project admin\",\"role_code\":\"Project manager,project_admin\",\"image_id\":\"\",\"region\":\"\",\"has_removed\":\"\"},\"position_float\":\"10000000000.0000000000\",\"belong_inside\":\"1\",\"regression_failure_number\":\"0\",\"src_domain\":{\"id\":\"1072203303493873664\",\"name\":\"beta-m2-wyl-021\",\"title\":\"beta-m2-wyl-021\",\"project_id\":\"b248a70bc6434e6bad54c8e73a222dca\",\"parent_id\":\"\",\"category\":\"Project\",\"created_by\":\"a360371833bf4c558f796fd707b44daf\",\"model_id\":\"10002\",\"children\":[]},\"domain_id\":{\"id\":\"1072203303493873664\",\"name\":\"beta-m2-wyl-021\",\"title\":\"beta-m2-wyl-021\",\"project_id\":\"b248a70bc6434e6bad54c8e73a222dca\",\"parent_id\":\"\",\"category\":\"Project\",\"created_by\":\"a360371833bf4c558f796fd707b44daf\",\"model_id\":\"10002\",\"children\":[]},\"send_from\":\"\",\"send_to\":\"\",\"stay_days\":2,\"test_report\":null,\"assigned_cc\":null,\"return_reason\":null,\"submit_time\":1733745191791,\"workitem2label\":null,\"close_time\":null,\"modified_date\":1733887226000,\"created_by\":{\"watcher\":0,\"user_id\":\"a360371833bf4c558f796fd707b44daf\",\"user_num_id\":4091,\"user_name\":\"devcloud_devcloud_01\",\"domain_id\":\"4e919d73499648e3b0292cd3cbef806a\",\"domain_name\":\"devcloud_devcloud_01\",\"nick_name\":\"Test account\",\"role_id\":\"257bbf34272649dd909bb35dfe27d126,05d9444b66cc4d5090ef3180a3096c91\",\"role_name\":\"Project admin,Project manager\",\"role_alias_name\":\"Project manager,Project admin\",\"role_code\":\"Project manager,project_admin\",\"image_id\":\"\",\"region\":\"\",\"has_removed\":\"\"},\"activate_times\":\"0\",\"status_modified_date\":1733745192515,\"parent_id\":null,\"business_domain\":null,\"found_pi\":null,\"region\":\"example\",\"reason_analysis\":null,\"link\":\"\",\"is_suspended\":null,\"origin_id\":\"1072968362439385089\",\"change_status\":{\"id\":\"1072203303896526856\",\"display_value\":\" unchange\",\"value\":\"unchange\",\"code\":\"unchange\",\"value_py\":\"unchange\",\"sequence\":1.0,\"level\":1,\"domain_id\":\"1072203303493873664\",\"belong_definition_type\":\"5\"},\"title\":\"21-Bug-01\",\"sum_workload_man_day\":null,\"plan_start_date\":null,\"severity\":{\"id\":\"1072203303896526851\",\"display_value\":\" Info\",\"value\":\"Info\",\"code\":\"Info\",\"value_py\":\"ts\",\"sequence\":1.0,\"level\":1,\"domain_id\":\"1072203303493873664\",\"belong_definition_type\":\"5\"},\"convolution_plan_hours\":null,\"submitted_by\":[{\"watcher\":0,\"user_id\":\"a360371833bf4c558f796fd707b44daf\",\"user_num_id\":4091,\"user_name\":\"devcloud_devcloud_01\",\"domain_id\":\"4e919d73499648e3b0292cd3cbef806a\",\"domain_name\":\"devcloud_devcloud_01\",\"nick_name\":\"Test account\",\"role_id\":\"257bbf34272649dd909bb35dfe27d126,05d9444b66cc4d5090ef3180a3096c91\",\"role_name\":\"Project manager,Project admin\",\"role_alias_name\":\"Project manager,Project admin\",\"role_code\":\"Project manager,project_admin\",\"image_id\":\"\",\"region\":\"\",\"has_removed\":\"\"}],\"sys_return_reason\":null,\"issue_review_id\":null,\"created_date\":1733745192388,\"category\":\"Bug\",\"setup\":true,\"collaborative_status\":[],\"parent_status\":\"no\"}}",
"before_change" : "{\"view\":{\"description\":\"<p>[Fault Symptom]</p><p><br></p><p>[Environment Information]</p><p><br></p><p>[Onsite Fault Locating R&D Engineer]</p><p><br></p><p>[Preliminary Fault Locating]</p>\"}}",
"category" : "CO",
"ccbs" : [ {
"id" : "a360371833bf4c558f796fd707b44daf",
"name" : "devcloud_devcloud_01",
"nick_name" : "Test account"
} ],
"change_type" : "Modify",
"co2review" : "1073568012549795840",
"created_by" : "a360371833bf4c558f796fd707b44daf",
"created_date" : "1733888157000",
"description" : "<p>[Fault Symptom]</p><p>x</p><p>[Environment Information]</p><p><br></p><p>[Onsite Fault Locating R&D Engineer]</p><p><br></p><p>[Preliminary Fault Locating]</p>",
"id" : "1073568002185670656",
"issue_id" : "1072968362439385089",
"issue_number" : "BUG20241209780441",
"issue_category" : "Bug",
"modified_by" : "a360371833bf4c558f796fd707b44daf",
"modified_date" : "1733888157000",
"opinions" : [ { } ],
"approver" : [ "a360371833bf4c558f796fd707b44daf" ],
"reviewer" : [ "a360371833bf4c558f796fd707b44daf" ],
"status" : "ToBeReviewed"
} ],
"cc" : [ {
"id" : "a360371833bf4c558f796fd707b44daf",
"name" : "devcloud_devcloud_01",
"nick_name" : "Test account"
} ]
}
} Status code: 400
{
"error_code" : "PM.02174103",
"error_msg" : "No permission."
} SDK Sample Code
The SDK sample code is as follows.
Java
Creating a BR
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 | 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 CreateIpdProcessInstanceSolution { 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(); CreateIpdProcessInstanceRequest request = new CreateIpdProcessInstanceRequest(); request.withProjectId("{project_id}"); CreateProcessInstanceReq body = new CreateProcessInstanceReq(); List<CreateProcessInstanceReqCos> listbodyCos = new ArrayList<>(); listbodyCos.add( new CreateProcessInstanceReqCos() .withNumber("IR20250716625228") .withIssueId("1152322333787987968") .withIssueCategory("IR") .withChangeType("Modify") .withBeforeChange("{"view":{}}") .withAfterChange("{"view":{},"execute":{}}") ); List<CreateProcessInstanceReqOpinions> listbodyOpinions = new ArrayList<>(); listbodyOpinions.add( new CreateProcessInstanceReqOpinions() .withUserId("09d25f5d3f80d2881fd7c008ecf1622b") .withCurrOwner("09d25f5d3f80d2881fd7c008ecf1622b") ); List<CreateProcessInstanceReqCcbs> listbodyCcbs = new ArrayList<>(); listbodyCcbs.add( new CreateProcessInstanceReqCcbs() .withUserId("09d25f5d3f80d2881fd7c008ecf1622b") ); body.withCos(listbodyCos); body.withOpinions(listbodyOpinions); body.withCcbs(listbodyCcbs); body.withStatus("ToBeReviewed"); body.withNeedApproval(true); body.withCategory("BR"); body.withDescription("<p><strong>[Background]</strong></p><p><br></p><p><strong>[Benefits]</strong></p><p><br></p><p><strong>[Details]</strong></p><br>"); body.withTitle("BR"); request.withBody(body); try { CreateIpdProcessInstanceResponse response = client.createIpdProcessInstance(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
Creating a BR
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 | # 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 = CreateIpdProcessInstanceRequest() request.project_id = "{project_id}" listCosbody = [ CreateProcessInstanceReqCos( number="IR20250716625228", issue_id="1152322333787987968", issue_category="IR", change_type="Modify", before_change="{"view":{}}", after_change="{"view":{},"execute":{}}" ) ] listOpinionsbody = [ CreateProcessInstanceReqOpinions( user_id="09d25f5d3f80d2881fd7c008ecf1622b", curr_owner="09d25f5d3f80d2881fd7c008ecf1622b" ) ] listCcbsbody = [ CreateProcessInstanceReqCcbs( user_id="09d25f5d3f80d2881fd7c008ecf1622b" ) ] request.body = CreateProcessInstanceReq( cos=listCosbody, opinions=listOpinionsbody, ccbs=listCcbsbody, status="ToBeReviewed", need_approval=True, category="BR", description="<p><strong>[Background]</strong></p><p><br></p><p><strong>[Benefits]</strong></p><p><br></p><p><strong>[Details]</strong></p><br>", title="BR" ) response = client.create_ipd_process_instance(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
Creating a BR
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 85 86 87 88 89 | 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.CreateIpdProcessInstanceRequest{} request.ProjectId = "{project_id}" numberCos:= "IR20250716625228" issueIdCos:= "1152322333787987968" issueCategoryCos:= "IR" changeTypeCos:= "Modify" beforeChangeCos:= "{"view":{}}" afterChangeCos:= "{"view":{},"execute":{}}" var listCosbody = []model.CreateProcessInstanceReqCos{ { Number: &numberCos, IssueId: &issueIdCos, IssueCategory: &issueCategoryCos, ChangeType: &changeTypeCos, BeforeChange: &beforeChangeCos, AfterChange: &afterChangeCos, }, } userIdOpinions:= "09d25f5d3f80d2881fd7c008ecf1622b" currOwnerOpinions:= "09d25f5d3f80d2881fd7c008ecf1622b" var listOpinionsbody = []model.CreateProcessInstanceReqOpinions{ { UserId: &userIdOpinions, CurrOwner: &currOwnerOpinions, }, } userIdCcbs:= "09d25f5d3f80d2881fd7c008ecf1622b" var listCcbsbody = []model.CreateProcessInstanceReqCcbs{ { UserId: &userIdCcbs, }, } needApprovalCreateProcessInstanceReq:= true request.Body = &model.CreateProcessInstanceReq{ Cos: &listCosbody, Opinions: &listOpinionsbody, Ccbs: &listCcbsbody, Status: "ToBeReviewed", NeedApproval: &needApprovalCreateProcessInstanceReq, Category: "BR", Description: "<p><strong>[Background]</strong></p><p><br></p><p><strong>[Benefits]</strong></p><p><br></p><p><strong>[Details]</strong></p><br>", Title: "BR", } response, err := client.CreateIpdProcessInstance(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 | OK |
| 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