0

I want to filter out deleted comment from a bitbucket cloud's pull request.

I tried the comment API endpoint: https://api.bitbucket.org/1.0/repositories/lereamede321/test-bitbucket-api/pullrequests/2/comments?q=deleted%3Dfalse&user.username%3Dleremede321. However, it does not support filtering on deleted field

I also tried activity API endpoint: https://api.bitbucket.org/2.0/repositories/leremede321/test-bitbucket-api/pullrequests/2/activity but it also includes updates, comments, etc. that I do not want. Also, I am unsure how to filter by type of the returned activities and filter by owner.

Is there a way to get around this?

Tuan Nguyen
  • 89
  • 1
  • 6

1 Answers1

-2

Try use jq

curl -s -X GET "https://api.bitbucket.org/2.0/repositories/$REPO_OWNER/$REPO_SLUG/pullrequests/$PR_ID/comments?access_token=$AT" | jq ".values[] | select(.deleted==false)"
ilyar
  • 1,331
  • 12
  • 21