-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.19.20
-
None
-
Severity 3 - Minor
-
Issue Summary
Parent field is null when retrieving PR comment
Steps to Reproduce
- Use the PR comment endpoint to get a comment that has a parent - https://developer.atlassian.com/server/bitbucket/rest/v906/api-group-pull-requests/#api-api-latest-projects-projectkey-repos-repositoryslug-pull-requests-pullrequestid-comments-commentid-get
Expected Results
The parent field is not null
Actual Results
The parent field is null
Workaround
Use the activitites API endpoint, # Make a GET request to: /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities
-
- Use Query Parameters:fromType=COMMENT: To filter for comment-related activities.
- fromId={nestedCommentId}{}: To filter the starting activity to be the one containing the nested comment.
- limit=1: To retrieve just the relevant activity for the comment ID.
- Extract the Root Comment: ** The response will contain an array of activities. The comment object within the first activity (activities[0].comment) will be the root comment of the thread, and it will contain its entire reply chain nested within its comments property (including the queried comment ID). If the comment ID is not matched to a pull request activity it throws a 404.