mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-27 21:38:54 +02:00
feat: Add Names support on Issue struct (#278)
This commit is contained in:
parent
3f966ddaaa
commit
1fc10e0606
1
issue.go
1
issue.go
@ -47,6 +47,7 @@ type Issue struct {
|
|||||||
RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"`
|
RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"`
|
||||||
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"`
|
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"`
|
||||||
Transitions []Transition `json:"transitions,omitempty" structs:"transitions,omitempty"`
|
Transitions []Transition `json:"transitions,omitempty" structs:"transitions,omitempty"`
|
||||||
|
Names map[string]string `json:"names,omitempty" structs:"names,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ChangelogItems reflects one single changelog item of a history item
|
// ChangelogItems reflects one single changelog item of a history item
|
||||||
|
@ -89,6 +89,23 @@ func TestSprintService_GetIssue(t *testing.T) {
|
|||||||
if len(issue.Fields.Comments.Comments) != 1 {
|
if len(issue.Fields.Comments.Comments) != 1 {
|
||||||
t.Errorf("Expected one comment, %v found", len(issue.Fields.Comments.Comments))
|
t.Errorf("Expected one comment, %v found", len(issue.Fields.Comments.Comments))
|
||||||
}
|
}
|
||||||
|
if len(issue.Names) != 10 {
|
||||||
|
t.Errorf("Expected 10 names, %v found", len(issue.Names))
|
||||||
|
}
|
||||||
|
if !reflect.DeepEqual(issue.Names, map[string]string{
|
||||||
|
"watcher": "watcher",
|
||||||
|
"attachment": "attachment",
|
||||||
|
"sub-tasks": "sub-tasks",
|
||||||
|
"description": "description",
|
||||||
|
"project": "project",
|
||||||
|
"comment": "comment",
|
||||||
|
"issuelinks": "issuelinks",
|
||||||
|
"worklog": "worklog",
|
||||||
|
"updated": "updated",
|
||||||
|
"timetracking": "timetracking",
|
||||||
|
}) {
|
||||||
|
t.Error("Expected names for the returned issue")
|
||||||
|
}
|
||||||
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