From 1c6fff62d55365a0296ef6912c52fedeb5bd8dfa Mon Sep 17 00:00:00 2001 From: Zach Smith Date: Tue, 23 Jan 2024 01:14:30 -0800 Subject: [PATCH 1/2] feat: add comment parent id --- bitbucket.go | 1 + pullrequests.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/bitbucket.go b/bitbucket.go index c7a4293..83a61f8 100644 --- a/bitbucket.go +++ b/bitbucket.go @@ -299,6 +299,7 @@ type PullRequestCommentOptions struct { PullRequestID string `json:"id"` Content string `json:"content"` CommentId string `json:"-"` + Parent *int `json:"parent"` } type IssuesOptions struct { diff --git a/pullrequests.go b/pullrequests.go index 55ec5b7..ca0e263 100644 --- a/pullrequests.go +++ b/pullrequests.go @@ -255,6 +255,12 @@ func (p *PullRequests) buildPullRequestCommentBody(co *PullRequestCommentOptions "raw": co.Content, } + if co.Parent != nil { + body["parent"] = map[string]interface{}{ + "id": co.Parent, + } + } + data, err := json.Marshal(body) if err != nil { return "", err From ed57b577db21ebe1077d1854b369107b4b868957 Mon Sep 17 00:00:00 2001 From: Zach Smith Date: Tue, 23 Jan 2024 01:15:39 -0800 Subject: [PATCH 2/2] feat: add comment parent id --- bitbucket.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbucket.go b/bitbucket.go index 83a61f8..89d12e8 100644 --- a/bitbucket.go +++ b/bitbucket.go @@ -299,7 +299,7 @@ type PullRequestCommentOptions struct { PullRequestID string `json:"id"` Content string `json:"content"` CommentId string `json:"-"` - Parent *int `json:"parent"` + Parent *int `json:"parent"` } type IssuesOptions struct {