1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-02-01 13:07:50 +02:00

Merge pull request #24 from ifosch/comments

Fix Comments unmarshalling
This commit is contained in:
Andy Grunwald 2016-07-10 20:52:35 +02:00 committed by GitHub
commit 55f76084ed
2 changed files with 10 additions and 1 deletions

View File

@ -78,7 +78,7 @@ type IssueFields struct {
AggregateProgress *Progress `json:"aggregateprogress,omitempty"`
Worklog *Worklog `json:"worklog,omitempty"`
IssueLinks []*IssueLink `json:"issuelinks,omitempty"`
Comments []*Comment `json:"comment.comments,omitempty"`
Comments *Comments `json:"comment,omitempty"`
FixVersions []*FixVersion `json:"fixVersions,omitempty"`
Labels []string `json:"labels,omitempty"`
Subtasks []*Subtasks `json:"subtasks,omitempty"`
@ -245,6 +245,11 @@ type IssueLinkType struct {
Outward string `json:"outward"`
}
// Comments represents a list of Comment.
type Comments struct {
Comments []*Comment `json:"comments,omitempty"`
}
// Comment represents a comment by a person to an issue in JIRA.
type Comment struct {
ID string `json:"id,omitempty"`

View File

@ -138,6 +138,10 @@ func TestIssueFields(t *testing.T) {
t.Error("Expected labels for the returned issue")
}
if len(issue.Fields.Comments.Comments) != 1 {
t.Errorf("Expected one comment, %v found", len(issue.Fields.Comments.Comments))
}
if err != nil {
t.Errorf("Error given: %s", err)
}