Updated on 2023-06-12 GMT+08:00

Query Defect Density

Function

Query Defect Density

URI

POST /v2/{project_id}/bug-density/query

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the 32-bit ID of the devcloud project.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

date_range

No

String

Frequency

metric_type

No

String

Metric Type

dividend

No

dividend object

Counter Numerator Filter Criteria

divisor

No

Object

Indicator Denominator Filter Criteria

Table 4 dividend

Parameter

Mandatory

Type

Description

custom_fields

No

Array of custom_fields objects

User-defined Filter Criteria

Table 5 custom_fields

Parameter

Mandatory

Type

Description

name

No

String

Indicates the customized field name.

options

No

String

Values of customized fields, which are separated by commas (,).

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

dividend_value

String

Numerator Value

divisor_value

String

Denominator

metric_name

String

Name

metric_value

String

Indicator Value

project_id

String

Project ID

project_name

String

Project

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_msg

String

Description

error_code

String

Error Codes

Example Requests

Post https://{endpoint}/v2/eace9c0a00574de6878ab580daa9a317/bug-density/query

{
  "date_range" : "1590940800000,1593446400000",
  "dividend" : {
    "custom_fields" : [ {
      "name" : "Indicates the customized field name.",
      "options" : "Indicates the customized field value."
    } ]
  },
  "divisor" : { },
  "metric_type" : "bug_density"
}

Example Responses

Status code: 200

OK

{
  "dividend_value" : 15,
  "divisor_value" : 20,
  "metric_name" : "completion_rate|bug_density|bugs_per_developer",
  "metric_value" : 0.8945,
  "project_id" : "eace9c0a00574de6878ab580daa9a317",
  "project_name" : "demo"
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.