1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-03-19 20:57:47 +02:00

feat: Add Names support on Issue struct ()

This commit is contained in:
Luke Young 2020-05-02 01:43:01 -07:00 committed by GitHub
parent 3f966ddaaa
commit 1fc10e0606
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

@ -47,6 +47,7 @@ type Issue struct {
RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"`
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,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

@ -89,6 +89,23 @@ func TestSprintService_GetIssue(t *testing.T) {
if len(issue.Fields.Comments.Comments) != 1 {
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 {
t.Errorf("Error given: %s", err)
}