You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this will cause the request to send visibility: {} which is rejected by the Jira API, the same happens with Author and UpdateAuthor properties.
A quick fix is making those fields a pointer like this:
// Comment represents a comment by a person to an issue in Jira.typeCommentstruct {
IDstring`json:"id,omitempty" structs:"id,omitempty"`Selfstring`json:"self,omitempty" structs:"self,omitempty"`Namestring`json:"name,omitempty" structs:"name,omitempty"`Author*User`json:"author,omitempty" structs:"author,omitempty"`Bodystring`json:"body,omitempty" structs:"body,omitempty"`UpdateAuthor*User`json:"updateAuthor,omitempty" structs:"updateAuthor,omitempty"`Updatedstring`json:"updated,omitempty" structs:"updated,omitempty"`Createdstring`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"`
}
this is tested and works as expected
The text was updated successfully, but these errors were encountered:
The reason is that the when serializing the body as json some extra is sent because the omitempty doesn't work as expected.
see this example: https://go.dev/play/p/7DCOpLbUdq4
this will cause the request to send
visibility: {}
which is rejected by the Jira API, the same happens with Author and UpdateAuthor properties.A quick fix is making those fields a pointer like this:
this is tested and works as expected
The text was updated successfully, but these errors were encountered: