Skip to content

Commit

Permalink
fix: update comment fields of struct type to be pointers to fix json …
Browse files Browse the repository at this point in the history
…marshal for addcomment method on issue service
  • Loading branch information
ominiet committed Dec 30, 2024
1 parent 48c5a07 commit 6a2c40b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions cloud/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,15 @@ type Comments struct {

// Comment represents a comment by a person to an issue in Jira.
type Comment struct {
ID string `json:"id,omitempty" structs:"id,omitempty"`
Self string `json:"self,omitempty" structs:"self,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Author User `json:"author,omitempty" structs:"author,omitempty"`
Body string `json:"body,omitempty" structs:"body,omitempty"`
UpdateAuthor User `json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"`
Updated string `json:"updated,omitempty" structs:"updated,omitempty"`
Created string `json:"created,omitempty" structs:"created,omitempty"`
Visibility CommentVisibility `json:"visibility,omitempty" structs:"visibility,omitempty"`
ID string `json:"id,omitempty" structs:"id,omitempty"`
Self string `json:"self,omitempty" structs:"self,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Author *User `json:"author,omitempty" structs:"author,omitempty"`
Body string `json:"body,omitempty" structs:"body,omitempty"`
UpdateAuthor *User `json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"`
Updated string `json:"updated,omitempty" structs:"updated,omitempty"`
Created string `json:"created,omitempty" structs:"created,omitempty"`
Visibility *CommentVisibility `json:"visibility,omitempty" structs:"visibility,omitempty"`

// A list of comment properties. Optional on create and update.
Properties []EntityProperty `json:"properties,omitempty" structs:"properties,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions cloud/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestIssueService_AddComment(t *testing.T) {

c := &Comment{
Body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
Visibility: CommentVisibility{
Visibility: &CommentVisibility{
Type: "role",
Value: "Administrators",
},
Expand Down Expand Up @@ -219,7 +219,7 @@ func TestIssueService_UpdateComment(t *testing.T) {
c := &Comment{
ID: "10001",
Body: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget venenatis elit. Duis eu justo eget augue iaculis fermentum. Sed semper quam laoreet nisi egestas at posuere augue semper.",
Visibility: CommentVisibility{
Visibility: &CommentVisibility{
Type: "role",
Value: "Administrators",
},
Expand Down Expand Up @@ -316,7 +316,7 @@ func TestIssueService_AddLink(t *testing.T) {
},
Comment: &Comment{
Body: "Linked related issue!",
Visibility: CommentVisibility{
Visibility: &CommentVisibility{
Type: "group",
Value: "jira-software-users",
},
Expand Down

0 comments on commit 6a2c40b

Please sign in to comment.