Updating the Release/Sprint Status
Function
This API is used to update the status of a release/sprint.
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
PUT /v1/planservice/projects/{project_id}/plans/{plan_id}/status
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition 32-character UUID of a project, which uniquely identifies a project. Obtain the value of this parameter from the project_id field in the response body of the API for querying the project list. Constraints A string of 32 characters consisting of letters and digits. Range N/A Default Value N/A |
| plan_id | Yes | String | Definition Unique ID of a release or sprint. You can obtain the release/sprint ID using the API for querying the release/sprint list. The value of the id field in the response message body is the release/sprint ID. Constraints A numeric string of 18 to 19 digits. Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| operate | Yes | String | Definition Operation type. Constraints N/A Range Default Value N/A |
| move_to_sprint_id | No | String | Definition Sprint ID to which the work item is moved. If the value of the operate parameter is complete, move the unfinished work items to another sprint. Constraints This parameter is mandatory when the value of operate is complete. An empty string indicates that the work item is moved to the "To be planned" state. Range The value is a numeric string of 18 to 19 characters. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Definition Response status. Range |
| message | String | Definition Prompt information. Range N/A |
| result | StatusChangeResult object | Definition Status change result data, including information about work items that cannot be completed. |
| Parameter | Type | Description |
|---|---|---|
| cannot_finish_ar | Array of WorkItemVO objects | Definition List of uncompleted AR work items. When a release/sprint is completed, the uncompleted AR work items will be listed here. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Unique ID of a work item. Range N/A |
| title | String | Definition Work item title. Range N/A |
| number | String | Definition Work item ID. Range N/A |
| category | String | Definition Work item type. Range N/A |
| status | StatusVO object | Definition Work item status information. |
| assignee | UserVO object | Definition Work item owner information. |
| baseline | String | Definition Work item baseline status. Range |
| change_status | String | Definition Work item change status. Range |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Status ID. Range N/A |
| name | String | Definition Status name. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition User ID, which is a 32-bit UUID. Range N/A |
| name | String | Definition Username. Range N/A |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_msg | String | Definition Error message. Range N/A |
| error_code | String | Definition Error code. Range N/A |
Example Requests
PUT https://{endpoint}/v1/planservice/projects/526cefde62004de2b62b5e8dd2c2b3af/plans/123456789012345678/status
{
"operate" : "move",
"move_to_sprint_id" : "12345678901234567890123456789012"
} Example Responses
Status code: 200
{
"status" : "success",
"message" : null,
"result" : {
"cannot_finish_ar" : [ {
"id" : "956239067176935424",
"title" : "AR work item 1",
"number" : "AR1234567890",
"category" : "AR",
"status" : {
"id" : "1",
"name" : "Ongoing"
},
"assignee" : {
"id" : "a360371833bf4c558f796fd707b44daf",
"name" : "User A"
},
"baseline" : "unbaseline",
"change_status" : "cannot_finish"
} ]
}
} Status code: 400
{
"error_msg" : "Parameter error. For example, the value of **operate** is not within the valid range.",
"error_code" : "PM.02175011"
} 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 | 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 ChangePlanStatusSolution { 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(); ChangePlanStatusRequest request = new ChangePlanStatusRequest(); request.withPlanId("{plan_id}"); request.withProjectId("{project_id}"); CompleteSprintVO body = new CompleteSprintVO(); body.withMoveToSprintId("12345678901234567890123456789012"); body.withOperate("move"); request.withBody(body); try { ChangePlanStatusResponse response = client.changePlanStatus(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 | # 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 = ChangePlanStatusRequest() request.plan_id = "{plan_id}" request.project_id = "{project_id}" request.body = CompleteSprintVO( move_to_sprint_id="12345678901234567890123456789012", operate="move" ) response = client.change_plan_status(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 | 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.ChangePlanStatusRequest{} request.PlanId = "{plan_id}" request.ProjectId = "{project_id}" moveToSprintIdCompleteSprintVo:= "12345678901234567890123456789012" request.Body = &model.CompleteSprintVo{ MoveToSprintId: &moveToSprintIdCompleteSprintVo, Operate: "move", } response, err := client.ChangePlanStatus(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 | Release/Sprint status updated successfully. |
| 400 | Bad Request |
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