Help Center> CodeArts Req> API Reference> APIs> Work Items of the Scrum Project> Obtaining Comments on a Specified Work Item
Updated on 2023-06-12 GMT+08:00

Obtaining Comments on a Specified Work Item

Function

Obtains comments on a work item.

URI

GET /v4/projects/{project_id}/issues/{issue_id}/comments

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the 32-bit ID of the devcloud project.

Minimum: 32

Maximum: 32

issue_id

Yes

Integer

Identifies a work item.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Pagination index, offset

Minimum: 0

Default: 0

limit

No

Integer

Number of records displayed on each page. A maximum of 100 records can be displayed.

Minimum: 1

Maximum: 100

Default: 10

Request Parameters

Table 3 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.

Minimum: 10

Maximum: 32768

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Total number of comments

comments

Array of IssueCommentV4 objects

Product Theory List

Table 5 IssueCommentV4

Parameter

Type

Description

comment

String

Indicates the comment content.

id

Integer

Identifies a comment.

created_time

String

Indicates the time when the comment is made.

user

CommentUserV4 object

  

Table 6 CommentUserV4

Parameter

Type

Description

user_num_id

Integer

Identifies a user who has posted a comment.

user_name

String

Indicates the name of the user who has posted a comment.

nick_name

String

Indicates the nickname of the user who has posted a comment.

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

Get https://{endpoint}/v4/projects/e2da96a5d2c845e284f0ad47f8ca8cb1/issues/1232495/comments

Get https://{endpoint}/v4/projects/e2da96a5d2c845e284f0ad47f8ca8cb1/issues/1232495/comments

Example Responses

Status code: 200

OK

{
  "total" : 3,
  "comments" : [ {
    "comment" : "<p>cost</p>",
    "id" : 2777430,
    "created_time" : "2019-10-18",
    "user" : {
      "user_num_id" : 4091,
      "user_name" : "demo_user_name",
      "nick_name" : "name"
    }
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

401

Unauthorized

Error Codes

See Error Codes.