1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-01-05 22:53:53 +02:00

Merge pull request #336 from madest92/bool-version

Fixed bool type for release version
This commit is contained in:
Benji Vesterby 2021-01-25 13:11:40 -08:00 committed by GitHub
commit 524ede3750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View File

@ -1739,8 +1739,8 @@ func TestIssueService_Get_Fields_AffectsVersions(t *testing.T) {
Name: "2.1.0-rc3",
Self: "http://www.example.com/jira/rest/api/2/version/10705",
ReleaseDate: "2018-09-30",
Released: false,
Archived: false,
Released: Bool(false),
Archived: Bool(false),
Description: "test description",
},
}) {

9
types.go Normal file
View File

@ -0,0 +1,9 @@
package jira
// Bool is a helper routine that allocates a new bool value
// to store v and returns a pointer to it.
func Bool(v bool) *bool {
p := new(bool)
*p = v
return p
}

View File

@ -20,8 +20,8 @@ type Version struct {
ID string `json:"id,omitempty" structs:"id,omitempty"`
Name string `json:"name,omitempty" structs:"name,omitempty"`
Description string `json:"description,omitempty" structs:"description,omitempty"`
Archived bool `json:"archived,omitempty" structs:"archived,omitempty"`
Released bool `json:"released,omitempty" structs:"released,omitempty"`
Archived *bool `json:"archived,omitempty" structs:"archived,omitempty"`
Released *bool `json:"released,omitempty" structs:"released,omitempty"`
ReleaseDate string `json:"releaseDate,omitempty" structs:"releaseDate,omitempty"`
UserReleaseDate string `json:"userReleaseDate,omitempty" structs:"userReleaseDate,omitempty"`
ProjectID int `json:"projectId,omitempty" structs:"projectId,omitempty"` // Unlike other IDs, this is returned as a number

View File

@ -61,7 +61,8 @@ func TestVersionService_Create(t *testing.T) {
Name: "New Version 1",
Description: "An excellent version",
ProjectID: 10000,
Released: true,
Released: Bool(true),
Archived: Bool(false),
ReleaseDate: "2010-07-06",
UserReleaseDate: "6/Jul/2010",
StartDate: "2018-07-01",