From 5f27aa465c73b0e8fe7952853a57924079bf4864 Mon Sep 17 00:00:00 2001 From: Patrick O'Connor Date: Mon, 31 Oct 2016 17:31:51 -0700 Subject: [PATCH 1/3] Added Parent to issue fields --- issue.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/issue.go b/issue.go index 604e285..e9b8db0 100644 --- a/issue.go +++ b/issue.go @@ -101,6 +101,7 @@ type IssueFields struct { Subtasks []*Subtasks `json:"subtasks,omitempty" structs:"subtasks,omitempty"` Attachments []*Attachment `json:"attachment,omitempty" structs:"attachment,omitempty"` Epic *Epic `json:"epic,omitempty" structs:"epic,omitempty"` + Parent *Parent `json:"parent,omitempty" structs:"parent,omitempty` Unknowns tcontainer.MarshalMap } @@ -261,6 +262,12 @@ type Progress struct { Total int `json:"total" structs:"total"` } +// Parent represents the parent of a JIRA issue, to be used with subtask issue types. +type Parent struct { + ID string `json:"id,omitempty" structs:id"` + Key string `json:"key,omitempty" structs:key"` +} + // Time represents the Time definition of JIRA as a time.Time of go type Time time.Time From 11bb1a8b275d271efe54516dd347f9938635a191 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Fri, 4 Nov 2016 20:44:23 +0100 Subject: [PATCH 2/3] Fixed structs tags of Parent struct --- issue.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/issue.go b/issue.go index e9b8db0..d9675b7 100644 --- a/issue.go +++ b/issue.go @@ -101,7 +101,7 @@ type IssueFields struct { Subtasks []*Subtasks `json:"subtasks,omitempty" structs:"subtasks,omitempty"` Attachments []*Attachment `json:"attachment,omitempty" structs:"attachment,omitempty"` Epic *Epic `json:"epic,omitempty" structs:"epic,omitempty"` - Parent *Parent `json:"parent,omitempty" structs:"parent,omitempty` + Parent *Parent `json:"parent,omitempty" structs:"parent,omitempty"` Unknowns tcontainer.MarshalMap } @@ -264,8 +264,8 @@ type Progress struct { // Parent represents the parent of a JIRA issue, to be used with subtask issue types. type Parent struct { - ID string `json:"id,omitempty" structs:id"` - Key string `json:"key,omitempty" structs:key"` + ID string `json:"id,omitempty" structs:"id"` + Key string `json:"key,omitempty" structs:"key"` } // Time represents the Time definition of JIRA as a time.Time of go From 542fcc2d4622ac7b76a73c28e3aaa73f2703b383 Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Fri, 4 Nov 2016 20:48:26 +0100 Subject: [PATCH 3/3] Fixed unit test to provide more information about the failure --- issue_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/issue_test.go b/issue_test.go index 56a1bbf..3e28f36 100644 --- a/issue_test.go +++ b/issue_test.go @@ -636,7 +636,7 @@ func TestIssueFields_MarshalJSON_Success(t *testing.T) { } if !reflect.DeepEqual(i, recieved) { - t.Errorf("Recieved object different from expected") + t.Errorf("Recieved object different from expected. Expected %+v, recieved %+v", i, recieved) } }