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

Querying the Operation History of a Test Plan

Function

Queries the operation history of a test plan.

URI

GET /v1/projects/{project_id}/plans/{plan_id}/journals

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.

plan_id

Yes

String

Test plan ID, which uniquely identifies a test plan. The value is a string of 11 to 34 characters.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Long

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Minimum: 0

Maximum: 999

Default: 0

limit

Yes

Long

Number of items displayed on each page. A maximum of 200 items are supported.

Minimum: 1

Maximum: 200

Default: 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 TestPlanJournalList objects

Response for querying the operation history of a test plan in a project

Table 5 TestPlanJournalList

Parameter

Type

Description

detail

Array of TestPlanJournalDetail objects

Historical record details

operate_time

String

Change time

operator

NameAndId object

Test plan iteration No. and iteration name

plan_id

String

Test plan ID

project_id

String

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

Table 6 TestPlanJournalDetail

Parameter

Type

Description

added

Array of NameAndId objects

Records of adding test plan resources (work items or test cases)

deleted

Array of NameAndId objects

Records of removing test plan resources (work items or test cases)

journalized_type

String

Specific type in change records. Example: test case or issue

type

String

Whether the basic information or a resource is changed (adding or removing issues/cases)

updated

Array of AttributeChange objects

Change of the basic information about the test plan. It includes the plan name, test type, plan processor, version number, associated iteration, start date, end date/deadline, and description.

Table 7 NameAndId

Parameter

Type

Description

id

String

Object ID

name

String

object name

Table 8 AttributeChange

Parameter

Type

Description

attribute_type

String

Changed test plan attributes

new_value

String

Changed value

old_value

String

Original value

Status code: 400

Table 9 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 10 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 11 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 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

Example Requests

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

Example Responses

Status code: 201

OK

[ {
  "detail" : [ {
    "added" : [ {
      "id" : "ID",
      "name" : "Name"
    } ],
    "deleted" : [ {
      "id" : "ID",
      "name" : "Name"
    } ],
    "journalized_type" : "plan",
    "type" : "resource/attribute",
    "updated" : [ {
      "attribute_type" : "name",
      "new_value" : "tester",
      "old_value" : "test"
    } ]
  } ],
  "operate_time" : "2021-07-10",
  "operator" : {
    "id" : "ID",
    "name" : "Name"
  },
  "plan_id" : "c7c2ddf2ea914164ac6ee76bf11a30ea",
  "project_id" : "9b26f58ec29943f681804a6628779a23"
} ]

Status Codes

Status Code

Description

201

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.