更新IPD变更评审单 - PutIpdChangeReviewFormV2
功能介绍
更新变更评审单,传参方式与portal页面一致。
调用方法
请参见如何调用API。
授权信息
账号根用户具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项。
URI
PUT /v2/ipdprojectservice/projects/{project_id}/review/{review_id}
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 参数解释: 项目32位ID,项目唯一标识。通过查询IPD项目列表获取,响应消息体中的id字段的值就是项目ID。 约束限制: 不涉及。 取值范围: 32个字符,由英文字母和数字组成。 默认取值: 不涉及。 |
| review_id | 是 | String | 参数解释: 评审单ID,评审单唯一标识。通过查询评审单列表(BR/GR)接口获取,响应消息体中的id字段的值就是评审单ID。 约束限制: 不涉及。 取值范围: 18~19个字符的数字字符串。 默认取值: 不涉及。 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| old_status | 否 | String | 参数解释: 评审单更新前状态。 约束限制: 0~32个字符。 取值范围: 默认取值: 不涉及。 |
| status | 否 | String | 参数解释: 评审单目标流转状态。 约束限制: 0~32个字符。 取值范围: 默认取值: 不涉及。 |
| plan_end_date | 否 | String | 参数解释: 计划完成时间,unix时间戳,单位:毫秒,示例:"1759420799999"。 约束限制: 不涉及。 取值范围: 不涉及。 默认取值: 不涉及。 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| status | String | 参数解释: 响应状态。 取值范围: |
| message | String | 参数解释: 响应信息。 取值范围: 不涉及。 |
| result | ReviewEntity object | 评审详情 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 参数解释: 评审单ID。 取值范围: 不涉及。 |
| number | String | 参数解释: 评审单编号。 取值范围: 不涉及。 |
| state | String | 参数解释: 评审单的生命周期。 取值范围: |
| title | String | 参数解释: 评审单标题。 取值范围: 不涉及。 |
| category | String | 参数解释: 评审单类别。 取值范围: CR:变更评审,BR:基线评审,GR:通用评审。 |
| created_by | UserEntity object | 参数解释: 评审单创建人。 |
| modified_by | UserEntity object | 参数解释: 评审单最后修改人。 |
| assigned_cc | Array of UserEntity objects | 参数解释: 评审单抄送人。 |
| created_time | String | 参数解释: 评审单创建时间戳。 取值范围: 不涉及。 |
| modified_time | String | 参数解释: 评审单最后修改时间戳。 取值范围: 不涉及。 |
| plan_end_date | String | 参数解释: 计划完成日期时间戳。 取值范围: 不涉及。 |
| plan_start_date | String | 参数解释: 计划开始日期时间戳。 取值范围: 不涉及。 |
| close_time | String | 参数解释: 评审单完成时间。 取值范围: 不涉及。 |
| need_approval | String | 参数解释: 评审单是否需要决策人审批。 取值范围: true、false。 |
| status | StatusEntity object | 参数解释: 评审单状态。 |
| description | String | 参数解释: 评审单描述。 取值范围: 不涉及。 |
| closed_time | String | 参数解释: 评审单完成时间。 取值范围: 不涉及。 |
| approver | String | 参数解释: 决策人ID。 取值范围: 不涉及。 |
| reviewer | String | 参数解释: 评审专家ID。 取值范围: 不涉及。 |
| cos | Array of COEntity objects | 参数解释: 评审对象列表。 |
| ccbs | Array of CcbEntity objects | 参数解释: 审批信息列表。 |
| old_status | StatusEntity object | 参数解释: 评审单历史状态。 |
| cc | Array of UserEntity objects | 参数解释: 抄送人列表。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| after_change | String | 参数解释: 变更对象修改后内容。 取值范围: 不涉及。 |
| review_complete_time | String | 参数解释: 变更对象评审完成时间。 取值范围: 不涉及。 |
| review_phase_result | String | 参数解释: 变更对象评审阶段结果。 取值范围: |
| review_time | String | 参数解释: 变更对象评审时间。 取值范围: 不涉及。 |
| before_change | String | 参数解释: 变更对象工作项修改前内容。 取值范围: 不涉及。 |
| category | String | 参数解释: 变更对象工作项类型,此处固定为CO。 取值范围: 不涉及。 |
| ccb_info | CcbEntity object | 参数解释: 变更对象实际决策人信息。 取值范围: 不涉及。 |
| ccbs | Array of UserEntity objects | 参数解释: 变更对象决策人列表,列表中只有一个元素。 取值范围: 不涉及。 |
| change_type | String | 参数解释: 变更类型。 取值范围: |
| co2review | String | 参数解释: 变更对象关联的评审单ID。 取值范围: 不涉及。 |
| created_by | String | 参数解释: 变更对象的创建人ID。 取值范围: 不涉及。 |
| created_date | String | 参数解释: 变更对象创建时间。 取值范围: 不涉及。 |
| description | String | 参数解释: 变更对象描述信息。 取值范围: 不涉及。 |
| id | String | 参数解释: 变更对象ID。 取值范围: 不涉及。 |
| issue_id | String | 参数解释: 变更对象关联的工作项ID。 取值范围: 不涉及。 |
| issue_number | String | 参数解释: 变更对象关联的工作项编号。 取值范围: 不涉及。 |
| issue_category | String | 参数解释: 变更对象关联的工作项类型。 取值范围: 不涉及。 |
| modified_by | String | 参数解释: 变更对象最后修改人ID。 取值范围: 不涉及。 |
| modified_date | String | 参数解释: 变更对象最后修改时间。 取值范围: 不涉及。 |
| opinions | Array of UserEntity objects | 参数解释: 变更对象评审专家Id列表(创建变更评审时使用)。 取值范围: 不涉及。 |
| opinion_comments | Array of ReviewOpinionEntity objects | 参数解释: 变更对象评审意见。 取值范围: 不涉及。 |
| review_comments | Array of ReviewCommentEntity objects | 参数解释: 变更对象评审意见(评审更新时使用)。 取值范围: 不涉及。 |
| approval_comments | Array of ReviewCommentEntity objects | 参数解释: 变更对象决策意见(决策更新时使用)。 取值范围: 不涉及。 |
| reviewer | Array of strings | 参数解释: 变更对象评审专家Id列表。 取值范围: 不涉及。 |
| approver | Array of strings | 参数解释: 变更对象决策人ID数组。 取值范围: 不涉及。 |
| status | String | 参数解释: 变更对象状态。 取值范围: |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| approval_time | String | 参数解释: 审批时间。 取值范围: 不涉及。 |
| category | String | 参数解释: 工作项类型,审批对象固定为CCB。 取值范围: 不涉及。 |
| ccb2review | String | 参数解释: 审批对象关联的评审单ID。 取值范围: 不涉及。 |
| co_id | String | 参数解释: 关联的变更对象ID。 取值范围: 不涉及。 |
| id | String | 参数解释: 审批对象ID。 取值范围: 不涉及。 |
| owner | UserEntity object | 参数解释: 决策人。 取值范围: 不涉及。 |
| approval_comments | String | 参数解释: 审批意见。 取值范围: 不涉及。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| category | String | 参数解释: 评审意见对象类型,固定为Opinion。 取值范围: 不涉及。 |
| co_id | String | 参数解释: 评审意见对象关联的变更对象ID。 取值范围: 不涉及。 |
| created_by | UserEntity object | 参数解释: 评审意见创建人,即评审专家。 取值范围: 不涉及。 |
| created_date | String | 参数解释: 评审意见创建时间。 取值范围: 不涉及。 |
| curr_owner | UserEntity object | 参数解释: 当前评审专家。 取值范围: 不涉及。 |
| id | String | 参数解释: 评审意见对象ID。 取值范围: 不涉及。 |
| modified_date | String | 参数解释: 评审意见最后修改时间。 取值范围: 不涉及。 |
| review_comments | String | 参数解释: 评审意见。 取值范围: 不涉及。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 参数解释: 评审意见对象ID。 取值范围: 不涉及。 |
| user_id | String | 参数解释: 评审用户ID。 取值范围: 不涉及。 |
| other_user_id | String | 参数解释: 其他用户Id(转他人)。 取值范围: 不涉及。 |
| result | String | 参数解释: 评审结果。 取值范围: 不涉及。 |
| comment | String | 参数解释: 评审意见。 取值范围: 不涉及。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 参数解释: 用户ID,可通过查询项目成员列表接口获取,响应消息体中的id字段的值就是用户ID。 取值范围: 不涉及。 |
| name | String | 参数解释: 用户名称。 取值范围: 2~64个字符。 |
| nick_name | String | 参数解释: 用户昵称。 取值范围: 2~30个字符。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| id | String | 参数解释: 状态ID。 取值范围: 不涉及。 |
| belonging | String | 参数解释: 工作项的状态属性。 取值范围: START、IN_PROGRESS、END。 |
| display_value | String | 参数解释: 状态名。 取值范围: 不涉及。 |
| code | String | 参数解释: 状态唯一标识。 取值范围: 不涉及。 |
| created_by | String | 参数解释: 状态创建人。 取值范围: 不涉及。 |
| created_time | String | 参数解释: 状态创建时间。 取值范围: 不涉及。 |
| modified_by | String | 参数解释: 状态修改人。 取值范围: 不涉及。 |
| modified_time | String | 参数解释: 状态最近修改时间。 取值范围: 不涉及。 |
| category_code | Array of strings | 参数解释: 状态被哪些工作项使用。 |
状态码:400
| 参数 | 参数类型 | 描述 |
|---|---|---|
| error_code | String | 参数解释: 错误码。 取值范围: 不涉及。 |
| error_msg | String | 参数解释: 错误描述,对error_code的补充解释。 取值范围: 不涉及。 |
请求示例
更新CR单计划完成时间
PUT https://{endpoint}/v2/ipdprojectservice/projects/b248a70bc6434e6bad54c8e73a222dca/review/1073568012549795840
{
"old_status" : "Committed",
"status" : "Committed",
"plan_end_date" : "1759420799999"
} 响应示例
状态码:200
OK
{
"status" : "success",
"message" : null,
"result" : {
"description" : "111",
"type" : "process_instance",
"title" : "test212222-update",
"multi_parent_id" : "",
"handing_cos" : "",
"review_type" : null,
"domain_id" : "1160948493073686528",
"number" : "CR20250812739484",
"review_times" : "0",
"need_approval" : true,
"plan_end_date" : "1759334399999",
"id" : "1162055387213373441",
"state" : "正在工作",
"plan_start_date" : "1757952000000",
"review_config" : {
"approval_type" : 0,
"ratio_value" : null,
"skip_decisioning" : false,
"approval_roles" : "241ea3ccd25a441a91d948e62dc1302c,c0619788f1f5421b81c30083a0b3a26a",
"review_roles" : "bbc80e4c2f5c4a3bb3f73faac744a883,107b73ca7834402ba15903bf182e6445,abeaf42190af4c338c3948d96fe3d871,0a353d02a6f1479c903bd8871762fea1,ef5c37da34164cc0bf38920f5b87b6c8,241ea3ccd25a441a91d948e62dc1302c,c0619788f1f5421b81c30083a0b3a26a,f40bc5b8e36249798072576276ee6dd5,ae187d881b574167bc1eaacae70aaf77,5604e92f78aa4946955ada93cc0df4d5,5c428ed6459b4111bcae2de8ea5f4336",
"project_need_approval" : true
},
"cc" : [ {
"watcher" : null,
"user_id" : "08792f514500d2091f5dc008bf8ee0b7",
"user_num_id" : null,
"user_name" : "test008",
"domain_id" : "4e919d73499648e3b0292cd3cbef806a",
"domain_name" : null,
"nick_name" : "z00513727",
"role_id" : "5c428ed6459b4111bcae2de8ea5f4336",
"role_name" : "浏览者",
"image_id" : null,
"region" : null,
"opinion" : null,
"description" : null,
"owner" : null,
"ccbId" : null,
"has_removed" : null
}, {
"watcher" : null,
"user_id" : "f197aacc6d4c46b8bcd2b8e3bf971138",
"user_num_id" : null,
"user_name" : "G30005585",
"domain_id" : "4e919d73499648e3b0292cd3cbef806a",
"domain_name" : null,
"nick_name" : "",
"role_id" : "5c428ed6459b4111bcae2de8ea5f4336",
"role_name" : "浏览者",
"image_id" : null,
"region" : null,
"opinion" : null,
"description" : null,
"owner" : null,
"ccbId" : null,
"has_removed" : null
} ],
"approver" : null,
"sub_id" : "",
"cr2co" : "",
"closed_time" : null,
"reviewer" : null,
"modified_date" : "1756708695698",
"created_by" : {
"watcher" : null,
"user_id" : "a360371833bf4c558f796fd707b44daf",
"user_num_id" : null,
"user_name" : "devcloud_devcloud_01",
"domain_id" : "4e919d73499648e3b0292cd3cbef806a",
"domain_name" : null,
"nick_name" : "CodeArts Doer",
"role_id" : "241ea3ccd25a441a91d948e62dc1302c,c0619788f1f5421b81c30083a0b3a26a",
"role_name" : "项目经理,项目管理员",
"image_id" : null,
"region" : null,
"opinion" : null,
"description" : null,
"owner" : null,
"ccbId" : null,
"has_removed" : null
},
"modified_by" : {
"watcher" : null,
"user_id" : "a360371833bf4c558f796fd707b44daf",
"user_num_id" : null,
"user_name" : "devcloud_devcloud_01",
"domain_id" : "4e919d73499648e3b0292cd3cbef806a",
"domain_name" : null,
"nick_name" : "CodeArts Doer",
"role_id" : "241ea3ccd25a441a91d948e62dc1302c,c0619788f1f5421b81c30083a0b3a26a",
"role_name" : "项目经理,项目管理员",
"image_id" : null,
"region" : null,
"opinion" : null,
"description" : null,
"owner" : null,
"ccbId" : null,
"has_removed" : null
},
"created_date" : "1754985194254",
"category" : "CR",
"status" : {
"code" : "Committed",
"name" : "待提交"
},
"stage" : "commit_phase",
"attachments" : [ ],
"wikis" : [ ],
"associatedocuments" : [ ],
"cos" : [ ],
"parents" : [ ],
"children" : [ ]
}
} 状态码:400
请求失败的响应。例如无操作权限、项目不存在。
{
"error_code" : "PM.02174103",
"error_msg" : "无操作权限"
} SDK代码示例
SDK代码示例如下。
Java
更新CR单计划完成时间
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 | 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.*; public class PutIpdChangeReviewFormV2Solution { 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(); PutIpdChangeReviewFormV2Request request = new PutIpdChangeReviewFormV2Request(); request.withProjectId("{project_id}"); request.withReviewId("{review_id}"); ReviewUpdateBodyV2 body = new ReviewUpdateBodyV2(); body.withPlanEndDate("1759420799999"); body.withStatus("Committed"); body.withOldStatus("Committed"); request.withBody(body); try { PutIpdChangeReviewFormV2Response response = client.putIpdChangeReviewFormV2(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
更新CR单计划完成时间
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 | # 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 = PutIpdChangeReviewFormV2Request() request.project_id = "{project_id}" request.review_id = "{review_id}" request.body = ReviewUpdateBodyV2( plan_end_date="1759420799999", status="Committed", old_status="Committed" ) response = client.put_ipd_change_review_form_v2(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
更新CR单计划完成时间
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 | 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.PutIpdChangeReviewFormV2Request{} request.ProjectId = "{project_id}" request.ReviewId = "{review_id}" planEndDateReviewUpdateBodyV2:= "1759420799999" statusReviewUpdateBodyV2:= "Committed" oldStatusReviewUpdateBodyV2:= "Committed" request.Body = &model.ReviewUpdateBodyV2{ PlanEndDate: &planEndDateReviewUpdateBodyV2, Status: &statusReviewUpdateBodyV2, OldStatus: &oldStatusReviewUpdateBodyV2, } response, err := client.PutIpdChangeReviewFormV2(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
更多
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
| 400 | 请求失败的响应。例如无操作权限、项目不存在。 |
错误码
请参见错误码。