Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update comment fields of struct type to be pointers to fix json … #695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 9 additions & 9 deletions onpremise/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,15 +471,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 onpremise/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
Loading