Help Center/ CodeArts Check/ API Reference/ APIs/ Task Management/ Querying Task Execution Record by Task ID
Updated on 2026-02-03 GMT+08:00

Querying Task Execution Record by Task ID

Function

This API is used to query the execution records of a task by task ID, execution time, and task execution status.

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

codeartscheck:task:get

Read

task *

-

-

-

-

codeartscheck:ProjectId

URI

GET /v4/tasks/{task_id}/jobs

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Definition :

Task ID, returned by the API for creating a check task. Each code check task, branch task, or incremental task generated through an API has a unique ID. Obtain the ID by calling the API used to . id indicates the task ID.

Constraints:

N/A

Value range:

1 to 128 characters.

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

statuses

No

Array of strings

Definition:

Task execution status.

Constraints:

N/A

Value range:

  • quering: initial state.

  • running: task being executed.

  • success: check successful.

  • failed: check failed.

  • aborted: task aborted.

Default value:

N/A

begin_start_time

No

String

Definition:

Check start time.

Constraints:

N/A

Value range:

Use UTC time in format "yyyy-MM-ddTHH:mm:ssZ". For example, 2020-09-25T12:05:00Z.

Default value:

N/A

end_start_time

No

String

Definition:

Check end time.

Constraints:

N/A

Value range:

Use UTC time in format "yyyy-MM-ddTHH:mm:ssZ". For example, 2020-09-25T12:05:00Z.

Default value:

N/A

page

No

Integer

Definition:

Page number.

Constraints:

N/A

Value range:

≥ 1

Default value:

1

page_size

No

Integer

Definition:

Page size.

Constraints:

N/A

Value range:

1–200

Default value:

200

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition :

User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token.

Constraints:

N/A

Value range:

1–100,000 characters.

Default value:

N/A

Content-Type

No

String

Definition:

Media type and encoding format.

Constraints:

N/A

Value range:

N/A

Default value:

application/json;charset=UTF-8

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

Array of SimpleJobInfoV4 objects

Definition:

Execution record list.

Range:

N/A

total

Integer

Definition:

Total number of executions.

Range:

N/A

Table 5 SimpleJobInfoV4

Parameter

Type

Description

subJobIds

Array of strings

Definition:

Subtask ID.

Value range:

N/A

finishTime

String

Definition:

End time.

Range:

N/A

subJobStatuses

Array of strings

Definition:

Subtask status.

Range:

N/A

reviewResult

String

Definition:

Gate check result.

Range:

  • success: The gate is passed.

  • error: The gate is not passed.

branchName

String

Definition:

Branch name.

Range:

N/A

source

String

Definition:

Task source.

Value range:

  • customer: triggered manually.

  • Scheduled: triggered by a scheduled task.

  • CodeCheckEdge: triggered by Edge.

  • CodeArtsPipeline: triggered by a pipeline.

  • DevCloudWebhook: triggered by a webhook from CodeArts Repo.

  • GitCodeActionPipeline: triggered by the GitCodeAction plug-in from the CodeArts Pipeline.

ruleSets

Array of strings

Definition:

Rule set.

Range:

N/A

executor

String

Definition:

Operator.

Range:

N/A

startTime

String

Definition:

Start time.

Range:

N/A

id

String

Definition:

Execution ID, which is returned by the API of code check task execution. Each code check task has a unique execution ID.

Value range:

N/A

jobType

String

Definition:

Task type.

Range:

  • FULL: version-level task.

  • INC_GIT: gate-level task.

  • INC_COMMIT: incremental check of a specified commit ID in a pipeline.

  • INC_LAST_SUCCESS_COMMIT: incremental check between the commit ID specified by a pipeline and the commit ID of the last successful gate check.

taskId

String

Definition :

Task ID, returned by the API for creating a check task. Each code check task, branch task, or incremental task generated through an API has a unique ID. Obtain the ID by calling the API used to . id indicates the task ID.

Value range:

N/A

status

String

Definition:

Task execution status.

Range:

  • quering: initial state.

  • running: task being executed.

  • success: check successful.

  • failed: check failed.

  • aborted: task aborted.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

Query the execution record of a code check task with the task ID a746dcxxxxxxxxxxxxxxx4339d7.

GET https://{endpoint}/v4/tasks/a746dcxxxxxxxxxxxxxxx4339d7/jobs

Example Responses

Status code: 200

Request succeeded!

{
  "data" : [ {
    "subJobIds" : [ ],
    "finishTime" : "2025-01-24T03:16:49Z",
    "subJobStatuses" : [ ],
    "reviewResult" : "success",
    "branchName" : "master",
    "source" : "customer",
    "ruleSets" : [ ],
    "executor" : "devcloud_codecheck_01",
    "startTime" : "2025-01-24T03:12:44Z",
    "id" : "07xxxxxxxxxxxxxxxxxxxxxxxxxxxxx29",
    "jobType" : "FULL",
    "taskId" : "d1xxxxxxxxxxxxxxxxxxxxxxxxxxxe",
    "status" : "success"
  }, {
    "subJobIds" : [ ],
    "finishTime" : "2024-11-01T07:59:28Z",
    "subJobStatuses" : [ ],
    "reviewResult" : "success",
    "branchName" : "master",
    "source" : "customer",
    "ruleSets" : [ ],
    "executor" : "P_codecheck001",
    "startTime" : "2024-11-01T07:58:31Z",
    "id" : "84xxxxxxxxxxxxxxxxxxxxxxxxxxxx6f",
    "jobType" : "FULL",
    "taskId" : "d1xxxxxxxxxxxxxxxxxxxxxxxxxxxe",
    "status" : "failed"
  } ],
  "total" : 2
}

Status code: 400

Bad Request

{
  "error_code" : "CC.xxxxxxxx.400",
  "error_msg" : "Verify request parameter failed. Check whether the request parameters are correct."
}

Status code: 401

Unauthorized

{
  "error_code" : "CC.00000003",
  "error_msg" : "Authentication information expired."
}

Status Codes

Status Code

Description

200

Request succeeded!

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.