Updated on 2026-02-03 GMT+08:00

Querying Tasks

Function

This API is used to query code check tasks in a project based on the project ID, task name, task group ID, and task execution status. Information such as the task name, code repository address, branch, configuration template ID, and rule set is returned.

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:list

List

task *

-

-

-

-

codeartscheck:ProjectId

URI

GET /v1/tasks

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

page

No

Integer

Definition:

Number of pages.

Constraints:

N/A

Value range:

≥ 1

Default value:

N/A

page_size

No

Integer

Definition:

Page size.

Constraints:

N/A

Value range:

1–200

Default value:

N/A

search

No

String

Definition:

Name of the task to be searched for.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

project_id

No

String

Definition :

Project ID. Obtain the ID by calling the API used to query the project list.

Constraints:

N/A

Value range:

32-character UUID.

Default value:

N/A

review_result_types

No

String

Definition:

Gate check result.

Constraints:

N/A

Value range:

  • success: The gate is passed.

  • error: The gate is not passed.

Default value:

N/A

job_status_types

No

String

Definition:

Check status.

Constraints:

N/A

Value range:

  • success: check successful.

  • failed: check failed.

  • aborted: The check is stopped.

  • executing: The task is being executed.

  • never_execute: The check has not been performed.

Default value:

N/A

order_by_execute_time

No

String

Definition:

Whether to sort tasks by execution time.

Constraints:

N/A

Value range:

  • up: Sort tasks by execution time in ascending order.

  • down: Sort tasks by execution time in descending order.

Default value:

N/A

task_classification_id

No

String

Definition:

Group ID of a task. You can obtain the group ID by calling the API for listing group information of a project.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

repo_url

No

String

Definition:

Code repository address.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

branch

No

String

Definition:

Branch.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

repo_url_full_match

No

String

Definition:

This parameter is used together with repo_url to determine whether to completely match repo_url when tasks are queried.

Constraints:

N/A

Value range:

  • true: Only the tasks whose code repository address is repo_url are queried.

  • false: Query the tasks whose repository address (using either the SSH protocol or the HTTP protocol) matches the repo_url.

Default value:

false

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

operator

No

String

Definition:

Operator username.

Constraints:

N/A

Value range:

1 to 128 characters.

Default value:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

httpStatus

String

Definition:

HTTP response status.

Value range:

  • OK: The request has been successfully processed, and the server returns the requested resource or operation result.

  • ACCEPTED: The request has been accepted by the server, but the processing is not complete (usually used for asynchronous operations).

  • INTERNAL_SERVER_ERROR: internal API exception.

  • BAD_REQUEST: abnormal parameter verification.

result

ShowTasksListResult object

Definition:

Response body for querying tasks.

Range:

N/A

status

String

Definition:

API response status.

Value range:

  • success: successful response.

  • error: response failed.

Table 4 ShowTasksListResult

Parameter

Type

Description

info

Array of TaskBasicInfo objects

Definition:

Task list.

Range:

N/A

total

Integer

Definition:

Total number of code check tasks.

Range:

N/A

Table 5 TaskBasicInfo

Parameter

Type

Description

branchName

String

Definition:

Branch name.

Range:

N/A

canDelete

Boolean

Definition:

Whether the user has the delete permission.

Value range:

  • true: The delete permission is granted.

  • false: The delete permission is not granted.

canEdit

Boolean

Definition:

Whether the user has the edit permission.

Value range:

  • true: The edit permission is granted.

  • false: The edit permission is not granted.

canExecute

Boolean

Definition:

Whether the user has the execute permission.

Value range:

  • true: The execute permission is granted.

  • false: The execute permission is not granted.

canRead

Boolean

Definition:

Whether the user has the read permission.

Value range:

  • true: The read permission is granted.

  • false: The read permission is not granted.

configTemplate

ConfigTemplateBasicInfo object

Definition:

Configuration template details.

configTemplateId

String

Definition:

ID of the task configuration template.

Value range:

1 to 128 characters.

createTime

String

Definition:

Task creation time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Value range:

N/A

id

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:

1 to 128 characters.

isFollowed

Boolean

Definition:

Whether a task is favorited.

Value range:

  • true: The task is favorited.

  • false: The task is not favorited.

jobResult

JobResultInfo object

Definition:

Execution result.

Range:

N/A

lastJob

JobBasicInfo object

Definition:

Execution record information.

Range:

N/A

lastUpdateTime

String

Definition:

Time (UTC) when a task was last updated. Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Value range:

N/A

name

String

Definition:

code check task name.

Range:

N/A

owner

String

Definition:

Owner of a code check task.

Range:

N/A

projectId

String

Definition :

32-character project UUID. Obtain it by calling the API used to query the project list.

Value range:

32 characters.

projectName

String

Definition:

Project name.

Range:

N/A

region

String

Definition:

Huawei Cloud region.

Range:

N/A

repoUrl

String

Definition:

Code repository address.

Range:

N/A

ruleSets

Array of ConfigTemplateRuleSetInfo objects

Definition:

Rule set configurations.

Range:

N/A

ruleType

String

Definition:

Task type.

Value range:

  • basic: general task.

  • security: security enhanced package task.

taskGroupId

String

Definition:

Task group ID.

Value range:

1 to 128 characters.

Table 6 ConfigTemplateBasicInfo

Parameter

Type

Description

arch

String

Definition:

Executor type.

Range:

x86 or Arm.

branch

String

Definition:

Branch name.

Range:

N/A

createTime

String

Definition:

Configuration template creation time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Value range:

N/A

creator

String

Definition:

Creator of the configuration template.

Range:

N/A

exclude

String

Definition:

Excluded directories in a task.

Range:

N/A

id

String

Definition:

Configuration template ID. The configuration template ID is required for modifying the configuration information. Each CodeArts Check task and its branch tasks have the same unique configuration template ID.

Value range:

N/A

includePaths

String

Definition:

Checked directory. If you do not specify any directory, all code files in the code repository are checked. If you specify one or more directories, only the files in the specified directories are checked.

Range:

N/A

lastReviser

String

Definition:

Last modifier name.

Range:

N/A

lastUpdateTime

String

Definition:

Time (UTC) when the configuration template was last modified. Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Value range:

N/A

name

String

Definition:

Name of a configuration template.

Range:

N/A

projectId

String

Definition :

32-character project UUID. Obtain it by calling the API used to query the project list.

Value range:

32 characters.

projectName

String

Definition:

Project name.

Range:

N/A

region

String

Definition:

Huawei Cloud region.

Range:

N/A

repoType

String

Definition:

Code repository type.

Value range:

  • DevCloud: CodeArts Repo repository.

  • Gitee: Gitee repository.

  • GitHub: GitHub repository.

  • GitPub: Git repository.

  • gitcode: GitCode repository.

  • gitlab: GitLab repository.

  • self_gitlab: self-built GitLab repository.

  • tfs_git: TFS repository.

  • bitbucket: Bitbucket repository.

repoUrl

String

Definition:

Code repository address.

Range:

N/A

resourcePoolId

String

Definition:

ID of an enabled agent pool. Leave this parameter as an empty string ("") when using built-in executors.

Value range:

N/A

resourcePoolName

String

Definition:

Name of an enabled agent pool. Leave this parameter blank when using built-in executors.

Range:

N/A

resource_pool_type

String

Definition:

Enabled agent pool type.

Value range:

  • default: built-in agent pool.

  • exclusive: dedicated agent pool.

  • self-hosted: self-hosted agent pool.

reviewData

Array of ReviewDataInfoResponse objects

Definition:

Task gate configurations.

Constraints:

N/A

Range:

N/A

Default value:

N/A

reviewDataJson

String

Definition:

JSON characters of the task gate configurations.

Range:

N/A

ruleSets

Array of ConfigTemplateRuleSetInfo objects

Definition:

Rule set configurations.

Range:

N/A

Table 7 ReviewDataInfoResponse

Parameter

Type

Description

compareType

String

Definition:

Calculation logic.

Range:

The value is .

isCheck

Integer

Definition:

Gate switch.

Value range:

  • 0: disabled.

  • 1: enabled.

name

String

Definition:

Gate item.

Range:

Number of critical issues.

Number of major issues.

Number of minor issues.

Number of suggestions.

value

Integer

Definition:

Gate threshold.

Value range:

≥0

Table 8 JobBasicInfo

Parameter

Type

Description

executor

String

Definition:

Name of the user who executes the task.

Range:

N/A

finishTime

String

Definition:

Execution completion time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

Value range:

N/A

jobResult

JobResultInfo object

Definition:

Execution result.

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.

process

ProcessInfo object

Definition:

Execution record information.

Range:

N/A

startTime

String

Definition:

Execution start time (UTC). Format: yyyy-MM-ddTHH:mm:ssZ. For example, 2025-11-28T06:55:41Z.

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.

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

Table 9 JobResultInfo

Parameter

Type

Description

CRITICAL

Integer

Definition:

Number of major issues.

Value range:

≥0

DELAYSTATUS_COUNT

Integer

Definition:

Number of deferred issues.

Value range:

≥0

FATAL

Integer

Definition:

Number of critical issues.

Value range:

≥0

GENERAL

Integer

Definition:

Number of minor issues.

Value range:

≥0

INFO

Integer

Definition:

Number of information issues.

Value range:

≥0

PROMPT

Integer

Definition:

Number of suggestions.

Value range:

≥0

codeLine

Integer

Definition:

Number of scanned code lines, excluding blank and comment lines.

Value range:

≥0

defectCount

Integer

Definition:

Total bugs.

Value range:

≥0

dismissed

Integer

Definition:

Number of ignored issues.

Value range:

≥0

fileTotal

Integer

Definition:

Total number of files.

Value range:

≥0

fixed

Integer

Definition:

Number of fixed issues.

Value range:

≥0

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

jobId

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

newUnsolvedDefectCount

Integer

Definition:

Number of new issues that are not resolved.

Value range:

≥0

nonSecurityDefectCount

Integer

Definition:

Number of non-security issues.

Value range:

≥0

reviewResult

String

Definition:

Gate check result.

Range:

  • success: The gate is passed.

  • error: The gate is not passed.

securityDefectCount

Integer

Definition:

Number of security issues.

Value range:

≥0

solvedDefectCount

Integer

Definition:

Number of resolved issues.

Range:

N/A

unsolvedDefectCount

Integer

Definition:

Number of unresolved issues.

Range:

N/A

Table 10 ProcessInfo

Parameter

Type

Description

exeTime

String

Definition:

Execution time, in seconds.

Range:

N/A

executeTime

String

Definition:

Execution time. The format is %dm%ds, for example, 6m6s.

Value range:

N/A

message

String

Definition:

Execution process.

Range:

N/A

process

String

Definition:

Task execution progress, in percentage.

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.

Table 11 ConfigTemplateRuleSetInfo

Parameter

Type

Description

language

String

Definition:

Language type.

Value range:

Custom language or system language. The following system languages are supported:

  • ArkTS

  • C#

  • Cangjie

  • C++

  • CSS

  • Go

  • HTML

  • Java

  • JavaScript

  • Kotlin

  • Lua

  • PHP

  • Python

  • Rust

  • Scala

  • Shell

  • SQL

  • Terraform

  • TypeScript

ruleSetId

String

Definition:

Rule set ID.

Value range:

1 to 32 characters.

Status code: 400

Table 12 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 13 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 code check task list of the project whose project ID is 685ddb216a12457593569a753e4d5573.

GET https://{endpoint}/v1/tasks?project_id=685ddb216a12457593569a753e4d5573

Example Responses

Status code: 200

The task list is displayed.

{
  "httpStatus" : "OK",
  "result" : {
    "info" : [ {
      "avastarType" : "pure-green",
      "branchName" : "master",
      "canDelete" : true,
      "canEdit" : true,
      "canExecute" : true,
      "canRead" : true,
      "checkParamList" : [ ],
      "configTemplate" : {
        "arch" : "X86",
        "branch" : "master",
        "checkersVersions" : [ ],
        "configImageMappings" : [ ],
        "createTime" : "2024-10-30T08:43:41Z",
        "creator" : "codecheck_gray02",
        "customParams" : [ ],
        "delayTime" : [ ],
        "engines" : [ ],
        "exclude" : "",
        "groups" : "",
        "id" : "107fc738969b11ef8ce6fa163e4dad77",
        "includePaths" : "",
        "lastReviser" : "codecheck_gray02",
        "lastUpdateTime" : "2024-10-30T08:43:41Z",
        "manifestFile" : "",
        "matchRepos" : "",
        "modelSets" : [ ],
        "name" : "template_107fc738969b11ef8ce6fa163e4dad77",
        "parentId" : "",
        "projectId" : "edd273b35def47278140367342aeb5e3",
        "projectName" : "Engine baseline cases (do not modify)",
        "region" : "suzhou",
        "repoType" : "DevCloud",
        "repoUrl" : "git@codehub.devcloud.cn-north-5.huaweicloud.com:edd273b35def47278140367342aeb5e3/engine_codemars_guiyi_java.git",
        "resourcePoolId" : "",
        "resourcePoolName" : "",
        "resource_pool_type" : "",
        "reviewData" : [ {
          "compareType" : "≤",
          "isCheck" : 1,
          "name" : "Number of critical issues.",
          "value" : 0
        }, {
          "compareType" : "≤",
          "isCheck" : 1,
          "name" : "Member of major issues.",
          "value" : 0
        }, {
          "compareType" : "≤",
          "isCheck" : 0,
          "name" : "Number of minor issues.",
          "value" : 0
        }, {
          "compareType" : "≤",
          "isCheck" : 0,
          "name" : "Number of suggestions.",
          "value" : 0
        } ],
        "reviewDataJson" : "[{\"compareType\":\"≤\",\"isCheck\":1,\"name\":\"Number of critical issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":1,\"name\":\"Number of major issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":0,\"name\":\"Number of minor issues\",\"value\":0},{\"compareType\":\"≤\",\"isCheck\":0,\"name\":\"Number of suggestion issues\",\"value\":0}]",
        "ruleSets" : [ {
          "language" : "JAVA",
          "ruleSetId" : "d2feb9c786054a8aa93ffc10dabb0b2b"
        } ],
        "toolImage" : "",
        "toolVersionId" : "",
        "type" : "private",
        "versionUpdateDelayDays" : [ ],
        "ymlPath" : "",
        "zone" : "green"
      },
      "configTemplateId" : "107fc738969b11ef8ce6fa163e4dad77",
      "createTime" : "2024-10-30T08:43:41Z",
      "criterionSets" : [ ],
      "customParams" : [ ],
      "id" : "51c9e8f2af4d49769c4e47e31243a3fd",
      "isDelete" : 1,
      "isFollowed" : true,
      "jobId" : "676672b0933e4c18a04e22d2df896364",
      "jobNum" : 0,
      "jobResult" : {
        "DELAYSTATUS_COUNT" : 0,
        "codeLine" : 616213,
        "defectCount" : 181187,
        "id" : "676672b0933e4c18a04e22d2df896364",
        "jobId" : "676672b0933e4c18a04e22d2df896364",
        "newUnsolvedDefectCount" : 6,
        "nonSecurityDefectCount" : 0,
        "reviewResult" : "error",
        "securityDefectCount" : 0,
        "solvedDefectCount" : 0,
        "unsolvedDefectCount" : 181187
      },
      "lastJob" : {
        "executor" : "codecheck_gray02",
        "finishTime" : "2025-09-12T08:41:26Z",
        "id" : "676672b0933e4c18a04e22d2df896364",
        "jobResult" : {
          "DELAYSTATUS_COUNT" : 0,
          "codeLine" : 616213,
          "defectCount" : 181187,
          "id" : "676672b0933e4c18a04e22d2df896364",
          "jobId" : "676672b0933e4c18a04e22d2df896364",
          "newUnsolvedDefectCount" : 6,
          "nonSecurityDefectCount" : 0,
          "reviewResult" : "error",
          "securityDefectCount" : 0,
          "solvedDefectCount" : 0,
          "unsolvedDefectCount" : 181187
        },
        "jobType" : "FULL",
        "process" : {
          "exeTime" : "468",
          "executeTime" : "7m48s",
          "message" : "2025/09/12 16:38:12 GMT+08:00 Running on server:21.102.***.***\n2025/09/12 16:38:13 GMT+08:00 waiting subJob to execute\n2025/09/12 16:41:17 GMT+08:00 start sync fixed defect snapshotData!\n2025/09/12 16:41:20 GMT+08:00 sync defect SnapshotData success!\n2025/09/12 16:41:21 GMT+08:00 flush redis cache successfully!\n2025/09/12 16:41:21 GMT+08:00 [WARNING]  : Some languages in the code are not checked! Languages in code: [SQL, SHELL], while in rules: [JAVA]\n2025/09/12 16:41:21 GMT+08:00 all subJob finish!\n",
          "process" : "100%",
          "status" : "success"
        },
        "ruleSets" : [ ],
        "startTime" : "2025-09-12T08:33:34Z",
        "status" : "success",
        "subJobIds" : [ ],
        "subJobStatuses" : [ ],
        "taskId" : "51c9e8f2af4d49769c4e47e31243a3fd"
      },
      "lastUpdateTime" : "2024-10-30T08:43:41Z",
      "modelSets" : [ ],
      "name" : "Engine task_ydf_Cloud-based P3C default rule set",
      "owner" : "codecheck_gray02",
      "projectId" : "edd273b35def47278140367342aeb5e3",
      "projectName" : "Engine baseline cases (do not modify)",
      "region" : "suzhou",
      "repoUrl" : "git@codehub.devcloud.cn-north-5.huaweicloud.com:edd273b35def47278140367342aeb5e3/engine_codemars_guiyi_java.git",
      "reviewData" : [ ],
      "ruleSets" : [ {
        "language" : "JAVA",
        "ruleSetId" : "d2feb9c786054a8aa93ffc10dabb0b2b"
      } ],
      "ruleType" : "basic",
      "tags" : "",
      "taskGroupId" : "65659ed7e5094e07bae22b93630f516d",
      "taskIds" : [ ],
      "zone" : "green"
    } ],
    "total" : 2631
  },
  "status" : "success"
}

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

The task list is displayed.

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.