mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-02-09 13:36:58 +02:00
Changed GetCreateMeta method to not require a projectKey. When a user passes in an empty string, it will retrieve the metadata for all projects.
Also changed "Subtasks" to "Subtask" to match Jira's data structure.
This commit is contained in:
parent
e04b45321e
commit
72b026679e
11
metaissue.go
11
metaissue.go
@ -36,7 +36,7 @@ type MetaIssueType struct {
|
|||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
IconUrl string `json:"iconurl,omitempty"`
|
IconUrl string `json:"iconurl,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Subtasks bool `json:"subtask,omitempty"`
|
Subtask bool `json:"subtask,omitempty"`
|
||||||
Expand string `json:"expand,omitempty"`
|
Expand string `json:"expand,omitempty"`
|
||||||
Fields tcontainer.MarshalMap `json:"fields,omitempty"`
|
Fields tcontainer.MarshalMap `json:"fields,omitempty"`
|
||||||
}
|
}
|
||||||
@ -44,7 +44,14 @@ type MetaIssueType struct {
|
|||||||
// GetCreateMeta makes the api call to get the meta information required to create a ticket
|
// GetCreateMeta makes the api call to get the meta information required to create a ticket
|
||||||
func (s *IssueService) GetCreateMeta(projectkey string) (*CreateMetaInfo, *Response, error) {
|
func (s *IssueService) GetCreateMeta(projectkey string) (*CreateMetaInfo, *Response, error) {
|
||||||
|
|
||||||
apiEndpoint := fmt.Sprintf("rest/api/2/issue/createmeta?projectKeys=%s&expand=projects.issuetypes.fields", projectkey)
|
apiEndpoint := ""
|
||||||
|
if len(projectkey) > 0 {
|
||||||
|
apiEndpoint = fmt.Sprintf("rest/api/2/issue/createmeta?projectKeys=%s&expand=projects.issuetypes.fields", projectkey)
|
||||||
|
}else {
|
||||||
|
apiEndpoint = fmt.Sprintf("rest/api/2/issue/createmeta?expand=projects.issuetypes.fields")
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(apiEndpoint)
|
||||||
|
|
||||||
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user