Help Center> CodeArts Repo> API Reference> APIs> Discussion> Setting for Obtaining Review Comments
Updated on 2023-12-04 GMT+08:00

Setting for Obtaining Review Comments

Function

Setting for Obtaining Review Comments

URI

GET /v2/repositories/{repository_id}/review_setting

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Warehouse Short ID

Minimum: 1

Maximum: 2147483647

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. Can be obtained by calling the IAM API for obtaining the user token (the value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

ReviewSettingDto object

Response

status

String

Response Status

Table 4 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 5 ReviewSettingDto

Parameter

Type

Description

categories_and_modules_enabled

Boolean

Whether to enable the review comment classification and module

secondary_category_enabled

Boolean

Enable Level-2 Category

forbidden_add_to_issue

Boolean

Indicates whether to forbid issue association.

primary_categories

Array of CategoryDto objects

Level-1 Category

Array Length: 0 - 100

review_default_categories

Array of Strings

Default Category

Array Length: 0 - 100

review_customized_categories

Array of Strings

Custom Classification

Array Length: 0 - 100

review_modules

Array of Strings

Review Comment Module

Array Length: 0 - 100

source_id

Integer

Target ID

Minimum: 1

Maximum: 2147483647

source_type

String

Destination Type

source_path

String

Target path

secondary_category_type

String

Level-2 Category Type

secondary_categories

Array of CategoryDto objects

Level-2

Table 6 CategoryDto

Parameter

Type

Description

key

String

key

name_zh

String

Name

name_en

String

English name

sub_categories

Array of CategoryDto objects

Level-2

Array Length: 0 - 100

Example Requests

GET https://{endpoint}/v2/repositories/{repository_id}/review_setting

{
  "body" : "Review comment title",
  "review_categories" : "",
  "review_modules" : "",
  "severity" : "suggestion",
  "assignee_id" : 9124
}

Example Responses

Status code: 200

OK

{
  "result" : {
    "categories_and_modules_enabled" : true,
    "secondary_category_enabled" : false,
    "primary_categories" : [ {
      "key" : "design",
      "name_zh" : "Design code.",
      "name_en" : "Code design"
    }, {
      "key" : "regulations",
      "name_zh" : "Programming Regulations",
      "name_en" : "Programming guideline"
    } ],
    "review_default_categories" : [ "design", "regulations" ],
    "review_customized_categories" : [ "xxx", "yyy" ],
    "review_modules" : [ "aaa", "bbb", "ccc" ],
    "source_id" : 2111699786,
    "source_type" : "Project",
    "source_path" : "DevOpsqlcylxm00004/project-test"
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.