get issue comments returns all the comment which don't have content.raw

Issue #83 invalid
Jothikannan Chandramohan created an issue

I am trying to get all the comments in an issue, in API 1.0 I can get all the comments which have the comment content, after API 2.0 the api call returns all the comments includes attachment activities, issue comment status activity. For example one of my issue have actual 5 comments, remaining 8 comments are attachment, edited description, Changed title. but on the API return these kind of activities are not returned it just content.raw objects are empty, so I am not able to show only comments

$page = new \Bitbucket\API\Http\Response\Pager($this->issue->getClient(), $this->issue->comments()->all($this->accountname, $this->repo_slug,$issue_id,['q' => ' content.raw != "null" ']));

Comments (4)

  1. Alexandru Guzinschi

    If you need only the comments, without attachment activities, you can just ignore any item from the response which has content.raw and/or content.html empty.

    content.raw contains the text as it was typed by a user, so in case of attachment activities for example, this will be empty, as the user didn’t typed anything.

    This has nothing to do with the client, as the client will return the response that it gets from the API server. If you think that the API server response is broken or that it should be changed, please fill an issue on Bitbucket issue tracker.

  2. Jothikannan Chandramohan reporter

    @Alexandru Guzinschi it makes sense, but if we ignore any item from the response which has content.raw, we might have the issue with the pagination as the size of response may not match. However I will fill an issue.

  3. Log in to comment