Skip to content

Commit 1fc10e0

Browse files
feat: Add Names support on Issue struct (#278)
1 parent 3f966dd commit 1fc10e0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

issue.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type Issue struct {
4747
RenderedFields *IssueRenderedFields `json:"renderedFields,omitempty" structs:"renderedFields,omitempty"`
4848
Changelog *Changelog `json:"changelog,omitempty" structs:"changelog,omitempty"`
4949
Transitions []Transition `json:"transitions,omitempty" structs:"transitions,omitempty"`
50+
Names map[string]string `json:"names,omitempty" structs:"names,omitempty"`
5051
}
5152

5253
// ChangelogItems reflects one single changelog item of a history item

sprint_test.go

+17
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,23 @@ func TestSprintService_GetIssue(t *testing.T) {
8989
if len(issue.Fields.Comments.Comments) != 1 {
9090
t.Errorf("Expected one comment, %v found", len(issue.Fields.Comments.Comments))
9191
}
92+
if len(issue.Names) != 10 {
93+
t.Errorf("Expected 10 names, %v found", len(issue.Names))
94+
}
95+
if !reflect.DeepEqual(issue.Names, map[string]string{
96+
"watcher": "watcher",
97+
"attachment": "attachment",
98+
"sub-tasks": "sub-tasks",
99+
"description": "description",
100+
"project": "project",
101+
"comment": "comment",
102+
"issuelinks": "issuelinks",
103+
"worklog": "worklog",
104+
"updated": "updated",
105+
"timetracking": "timetracking",
106+
}) {
107+
t.Error("Expected names for the returned issue")
108+
}
92109
if err != nil {
93110
t.Errorf("Error given: %s", err)
94111
}

0 commit comments

Comments
 (0)