mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-02-13 13:48:28 +02:00
Comments unmarshaling fixed
This commit is contained in:
parent
6c73f2f575
commit
f7ea942ed3
7
issue.go
7
issue.go
@ -78,7 +78,7 @@ type IssueFields struct {
|
|||||||
AggregateProgress *Progress `json:"aggregateprogress,omitempty"`
|
AggregateProgress *Progress `json:"aggregateprogress,omitempty"`
|
||||||
Worklog *Worklog `json:"worklog,omitempty"`
|
Worklog *Worklog `json:"worklog,omitempty"`
|
||||||
IssueLinks []*IssueLink `json:"issuelinks,omitempty"`
|
IssueLinks []*IssueLink `json:"issuelinks,omitempty"`
|
||||||
Comments []*Comment `json:"comment.comments,omitempty"`
|
Comments *Comments `json:"comment,omitempty"`
|
||||||
FixVersions []*FixVersion `json:"fixVersions,omitempty"`
|
FixVersions []*FixVersion `json:"fixVersions,omitempty"`
|
||||||
Labels []string `json:"labels,omitempty"`
|
Labels []string `json:"labels,omitempty"`
|
||||||
Subtasks []*Subtasks `json:"subtasks,omitempty"`
|
Subtasks []*Subtasks `json:"subtasks,omitempty"`
|
||||||
@ -245,6 +245,11 @@ type IssueLinkType struct {
|
|||||||
Outward string `json:"outward"`
|
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.
|
// Comment represents a comment by a person to an issue in JIRA.
|
||||||
type Comment struct {
|
type Comment struct {
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
|
@ -138,6 +138,10 @@ func TestIssueFields(t *testing.T) {
|
|||||||
t.Error("Expected labels for the returned issue")
|
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 {
|
if err != nil {
|
||||||
t.Errorf("Error given: %s", err)
|
t.Errorf("Error given: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user