Updated on 2026-10-13 GMT+08:00

Updating a Plan

Function

This API is used to update specified plan information, including milestone, release, and sprint attributes.

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.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsreq:plan:update

Write

-

  • codeartsreq:Model

  • codeartsreq:ProjectId

-

-

URI

PUT /v1/planservice/projects/{project_id}/plans/{plan_id}

Table 1 Path Parameters

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

Table 2 Request header 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

A string of 10 to 32,768 characters

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

id

No

String

Definition:

ID of a release, sprint, or milestone.

Value range:

N/A

title

No

String

Definition:

Title.

Options:

N/A

category

No

String

Definition:

Type. The value is of the enumerated type.

Value range:

PI: release

Iteration: sprint

PlanMilestone: milestone

description

No

String

Definition:

Description

Options:

N/A

status

No

String

Definition:

Release/Sprint status. The value is of the enumerated type.

Value range:

planned: not started

going: ongoing

ended

children

No

Array of PlanVO objects

Definition:

Sub-project sprint information.

modified_by

No

String

Definition

ID of the last updater.

Range

N/A

plan_start_date

No

String

Definition

Planned start time, in the format of "yyyy-MM-dd". Example: 2024-01-01.

Range

N/A

plan_end_date

No

String

Definition

Planned completion time, in the format of "yyyy-MM-dd". Example: 2024-01-01.

Range

N/A

created_date

No

Long

Definition:

Creation time, which is a Unix timestamp (unit: millisecond).

Options:

N/A

parent_id

No

String

Definition

Parent work item ID. When the plan type is iteration, this parameter specifies the release plan to which the work item belongs.

Constraints

A numeric string of 18 to 19 digits.

Range

N/A

Default Value

N/A

baseline

No

String

Definition

Baseline status. The value is of the enumerated type and indicates whether the plan has been included in baseline management.

Constraints

N/A

Range

  • baselined

  • unbaseline

  • "" (not baselined)

workload

No

String

Definition

Estimated workload, which is used to identify the required workforce or time investment for the plan. The unit is person/day.

Constraints

N/A

Range

Max. 11 characters.

Default Value

N/A

owner

No

String

Definition

Owner ID, which identifies the owner of a plan.

Constraints

N/A

Range

A string of 32 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

status

String

Definition

Response status.

Range

  • success: The operation succeeded.

  • error: The operation failed.

message

String

Definition

Prompt information.

Range

N/A

result

PlanResponseResult object

Definition

Plan details, including complete information about the release/sprint.

Table 5 PlanResponseResult

Parameter

Type

Description

id

String

Definition

ID of a release, sprint, or milestone.

Range

N/A

title

String

Definition

Title

Range

N/A

category

String

Definition

Type. The value is of the enumerated type.

Range

  • PI: release

  • Iteration: sprint

  • PlanMilestone: milestone

description

String

Definition

Description.

Range

N/A

state

String

Definition

Discard flag. The value is of the enumerated type.

Range

  • In use: releases that can be operated normally.

  • Discarded: releases that have been soft deleted.

  • Deleted: releases that have been permanently deleted.

status

String

Definition

Release/Sprint status. The value is of the enumerated type.

Range

  • planned: not started

  • going: ongoing

  • ended

children

Array of PlanResponseResult objects

Definition

Sub-project sprint information.

created_by

String

Definition

Creator ID.

Range

N/A

modified_by

String

Definition

ID of the last updater.

Range

N/A

plan_start_date

Long

Definition

Plan start time, which is a Unix timestamp (unit: millisecond).

Range

N/A

plan_end_date

Long

Definition

Plan completion time, which is a Unix timestamp (unit: millisecond).

Range

N/A

created_date

Long

Definition

Creation time, which is a Unix timestamp (unit: millisecond).

Range

N/A

parent_id

String

Definition

Parent plan ID. When the plan type is iteration, this parameter specifies the release plan to which the work item belongs.

Range

The value is a numeric string of 18 to 19 characters.

baseline

String

Definition

Baseline status. The value is of the enumerated type and indicates whether the plan has been included in baseline management.

Range

  • baselined

  • unbaseline

  • "" (not baselined)

workload

String

Definition

Estimated workload, which is used to identify the required workforce or time investment for the plan. The unit is person/day.

Range

Max. 11 characters.

owner

String

Definition

Owner ID, which identifies the owner of a plan.

Range

A string of 32 characters.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error message.

Range

N/A

Example Requests

Request parameters for updating a plan

PUT https://{endpoint}/v1/planservice/projects/1234567890abcdef1234567890abcdef/plans/abcdef1234567890abcdef1234567890

{
  "title" : "Updated Plan Title",
  "category" : "PI",
  "description" : "This is the updated plan description.",
  "status" : "going",
  "plan_start_date" : 1701456000000,
  "plan_end_date" : 1702060800000,
  "created_date" : 1701456000000,
  "parent_id" : "0987654321fedcba0987654321fedcba",
  "baseline" : "unbaseline",
  "workload" : "20h",
  "owner" : "33333333333333333333333333333333"
}

Example Responses

Status code: 200

{
  "status" : "success",
  "message" : "Plan updated.",
  "result" : {
    "id" : "123456789012345678",
    "title" : "Updated Plan Title",
    "category" : "PI",
    "description" : "This is the updated plan description.",
    "state" : "In use",
    "status" : "going",
    "children" : [ ],
    "created_by" : "11111111111111111111111111111111",
    "modified_by" : "22222222222222222222222222222222",
    "plan_start_date" : 1701456000000,
    "plan_end_date" : 1702060800000,
    "created_date" : 1701456000000,
    "parent_id" : "0987654321fedcba0987654321fedcba",
    "baseline" : "unbaseline",
    "workload" : "20h",
    "owner" : "33333333333333333333333333333333"
  }
}

Status code: 400

{
  "error_code" : "PM.02175011",
  "error_msg" : "Invalid parent_id."
}

SDK Sample Code

The SDK sample code is as follows.

Java

Request parameters for updating a plan

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package 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 UpdatePlanInfoSolution {

    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();
        UpdatePlanInfoRequest request = new UpdatePlanInfoRequest();
        request.withPlanId("{plan_id}");
        request.withProjectId("{project_id}");
        PlanVO body = new PlanVO();
        body.withOwner("33333333333333333333333333333333");
        body.withWorkload("20h");
        body.withBaseline("unbaseline");
        body.withParentId("0987654321fedcba0987654321fedcba");
        body.withCreatedDate(1701456000000L);
        body.withPlanEndDate("1702060800000");
        body.withPlanStartDate("1701456000000");
        body.withStatus("going");
        body.withDescription("This is the updated plan description.");
        body.withCategory("PI");
        body.withTitle("Updated Plan Title");
        request.withBody(body);
        try {
            UpdatePlanInfoResponse response = client.updatePlanInfo(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

Request parameters for updating a plan

 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
# 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 = UpdatePlanInfoRequest()
        request.plan_id = "{plan_id}"
        request.project_id = "{project_id}"
        request.body = PlanVO(
            owner="33333333333333333333333333333333",
            workload="20h",
            baseline="unbaseline",
            parent_id="0987654321fedcba0987654321fedcba",
            created_date=1701456000000,
            plan_end_date="1702060800000",
            plan_start_date="1701456000000",
            status="going",
            description="This is the updated plan description.",
            category="PI",
            title="Updated Plan Title"
        )
        response = client.update_plan_info(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

Request parameters for updating a plan

 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
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.UpdatePlanInfoRequest{}
	request.PlanId = "{plan_id}"
	request.ProjectId = "{project_id}"
	ownerPlanVo:= "33333333333333333333333333333333"
	workloadPlanVo:= "20h"
	baselinePlanVo:= "unbaseline"
	parentIdPlanVo:= "0987654321fedcba0987654321fedcba"
	createdDatePlanVo:= int64(1701456000000)
	planEndDatePlanVo:= "1702060800000"
	planStartDatePlanVo:= "1701456000000"
	statusPlanVo:= "going"
	descriptionPlanVo:= "This is the updated plan description."
	categoryPlanVo:= "PI"
	titlePlanVo:= "Updated Plan Title"
	request.Body = &model.PlanVo{
		Owner: &ownerPlanVo,
		Workload: &workloadPlanVo,
		Baseline: &baselinePlanVo,
		ParentId: &parentIdPlanVo,
		CreatedDate: &createdDatePlanVo,
		PlanEndDate: &planEndDatePlanVo,
		PlanStartDate: &planStartDatePlanVo,
		Status: &statusPlanVo,
		Description: &descriptionPlanVo,
		Category: &categoryPlanVo,
		Title: &titlePlanVo,
	}
	response, err := client.UpdatePlanInfo(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

Plan updated successfully.

400

Error message.

Error Codes

See Error Codes.