Skip to content

Commit f9c91e2

Browse files
authored
Merge pull request #115 from Hoid/master
Fix GetQueryOptions in issue.go to use projectKeys instead of projectKey
2 parents 61dbee1 + 4a727d9 commit f9c91e2

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

issue.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,9 @@ type GetQueryOptions struct {
508508
// Properties is the list of properties to return for the issue. By default no properties are returned.
509509
Properties string `url:"properties,omitempty"`
510510
// FieldsByKeys if true then fields in issues will be referenced by keys instead of ids
511-
FieldsByKeys bool `url:"fieldsByKeys,omitempty"`
512-
UpdateHistory bool `url:"updateHistory,omitempty"`
513-
ProjectKey string `url:"projectKey,omitempty"`
511+
FieldsByKeys bool `url:"fieldsByKeys,omitempty"`
512+
UpdateHistory bool `url:"updateHistory,omitempty"`
513+
ProjectKeys string `url:"projectKeys,omitempty"`
514514
}
515515

516516
// CustomFields represents custom fields of JIRA

metaissue.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/trivago/tgo/tcontainer"
87
"github.com/google/go-querystring/query"
8+
"github.com/trivago/tgo/tcontainer"
99
)
1010

1111
// CreateMetaInfo contains information about fields and their attributed to create a ticket.
@@ -37,14 +37,14 @@ type MetaIssueType struct {
3737
Description string `json:"description,omitempty"`
3838
IconUrl string `json:"iconurl,omitempty"`
3939
Name string `json:"name,omitempty"`
40-
Subtasks bool `json:"subtask,omitempty"`
40+
Subtasks bool `json:"subtask,omitempty"`
4141
Expand string `json:"expand,omitempty"`
4242
Fields tcontainer.MarshalMap `json:"fields,omitempty"`
4343
}
4444

4545
// GetCreateMeta makes the api call to get the meta information required to create a ticket
46-
func (s *IssueService) GetCreateMeta(projectkey string) (*CreateMetaInfo, *Response, error) {
47-
return s.GetCreateMetaWithOptions(&GetQueryOptions{ProjectKey: projectkey, Expand: "projects.issuetypes.fields"})
46+
func (s *IssueService) GetCreateMeta(projectkeys string) (*CreateMetaInfo, *Response, error) {
47+
return s.GetCreateMetaWithOptions(&GetQueryOptions{ProjectKeys: projectkeys, Expand: "projects.issuetypes.fields"})
4848
}
4949

5050
// GetCreateMetaWithOptions makes the api call to get the meta information without requiring to have a projectKey
@@ -58,7 +58,7 @@ func (s *IssueService) GetCreateMetaWithOptions(options *GetQueryOptions) (*Crea
5858
if options != nil {
5959
q, err := query.Values(options)
6060
if err != nil {
61-
return nil, nil , err
61+
return nil, nil, err
6262
}
6363
req.URL.RawQuery = q.Encode()
6464
}
@@ -72,6 +72,7 @@ func (s *IssueService) GetCreateMetaWithOptions(options *GetQueryOptions) (*Crea
7272

7373
return meta, resp, nil
7474
}
75+
7576
// GetProjectWithName returns a project with "name" from the meta information received. If not found, this returns nil.
7677
// The comparison of the name is case insensitive.
7778
func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject {

0 commit comments

Comments
 (0)