Skip to content

Commit

Permalink
feat: Add Names support on Issue struct (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
bored-engineer authored May 2, 2020
1 parent 3f966dd commit 1fc10e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions sprint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1fc10e0

Please sign in to comment.