Help Center/ CodeArts TestPlan/ API Reference/ API/ Test Plan Management/ Querying the Test Plan List in a Project
Updated on 2023-06-26 GMT+08:00

Querying the Test Plan List in a Project

Function

Queries the test plan list in a project.

URI

GET /v1/projects/{project_id}/plans

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

DevCloud project ID, which uniquely identifies a project. The value contains 32 characters.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

name

No

String

Used for fuzzy query (for test plan names)

current_stage

No

String

Test plan stage (create, design, execute, or report)

offset

Yes

Integer

Page number. The value ranges from 1 to 20000.

limit

Yes

Integer

Number of items displayed on each page. The value ranges from 1 to 200.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Call IAM to obtain the user token (value of X-Subject-Token in the response header).

Response Parameters

Status code: 201

Table 4 Response body parameters

Parameter

Type

Description

[items]

Array of TestPlanDetail objects

Response for querying the test plan list in a project

Table 5 TestPlanDetail

Parameter

Type

Description

creator

creator object

Test plan creator information

current_stage

String

Stage of the current test plan

design_stage

design_stage object

Information about the test plan design stage

end_date

String

Test plan deadline

execute_stage

execute_stage object

Information about the test plan execution stage

expire_day

String

Obtains the expiration time. A positive value indicates that the plan has expired.

finish_date

String

Actual completion time of the test plan (Actual completion of the test plan means that all test cases under the test plan are completed.)

iteration

NameAndId object

Test plan iteration No. and iteration name

name

String

Test plan name

owner

owner object

Test plan processor information

plan_id

String

Test plan ID

project_id

String

Project ID

report_stage

report_stage object

Statistics in the report stage

start_date

String

Test plan start time

Table 6 creator

Parameter

Type

Description

id

String

ID of the test plan creator

nick_name

String

Alias of the test plan creator. This parameter is not returned if the user does not set an alias.

user_name

String

Name of the test plan creator

Table 7 design_stage

Parameter

Type

Description

case_count

Integer

Number of cases

issue_count

Integer

Number of requirements

issue_covered_count

String

Number of requirements associated with test cases

Table 8 execute_stage

Parameter

Type

Description

case_pass_rate

String

Test case pass rate, which is calculated based on test case results

completed_defect_count

Integer

Number of completed defects

defect_count

Integer

Number of defects

executed_case_count

Integer

Number of executed test cases, counted by test case status

Table 9 NameAndId

Parameter

Type

Description

id

String

Object ID

name

String

object name

Table 10 owner

Parameter

Type

Description

id

String

Test plan processor ID

name

String

Name of the test plan processor. nickName is returned first. If nickName does not exist, userName is returned.

nick_name

String

Alias of the test plan processor. This parameter is not returned if the user does not set an alias.

user_name

String

Username of the test plan processor

Table 11 report_stage

Parameter

Type

Description

case_complete_rate

String

Case completion rate, which is calculated by status

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 401

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 404

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Status code: 500

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code displayed after an API fails to be called

error_msg

String

Error message displayed after an API fails to be called

Example Requests

get https://{endpoint}/v1/projects/efdb403066474ab08836b9eeaaa23bca/plans?offset=1&limit=10&current_stage

Example Responses

Status code: 201

OK

[ {
  "creator" : {
    "id" : "efdb403066474ab08836b9eeaaa23bca",
    "nick_name" : "Tester",
    "user_name" : "Tester"
  },
  "current_stage" : "design",
  "design_stage" : {
    "case_count" : 2,
    "issue_count" : 0,
    "issue_covered_count" : "0"
  },
  "end_date" : "2021-07-10",
  "execute_stage" : {
    "case_pass_rate" : "0.00%",
    "completed_defect_count" : 0,
    "defect_count" : 0,
    "executed_case_count" : 0
  },
  "expire_day" : "-4",
  "finish_date" : "2021-07-10",
  "iteration" : {
    "id" : "ID",
    "name" : "Name"
  },
  "name" : "Test",
  "owner" : {
    "id" : "efdb403066474ab08836b9eeaaa23bca",
    "name" : "Tester",
    "nick_name" : "Tester",
    "user_name" : "Tester"
  },
  "plan_id" : "c7c2ddf2ea914164ac6ee76bf11a30ea",
  "project_id" : "9b26f58ec29943f681804a6628779a23",
  "report_stage" : {
    "case_complete_rate" : "100.00%"
  },
  "start_date" : "2021-07-10"
} ]

Status Codes

Status Code

Description

201

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.