Skip to content

Commit

Permalink
Add URL escaping to an additional issuetype call
Browse files Browse the repository at this point in the history
In #34 a fix was made to escape the issue type to support issue types
with spaces in. This is an additional place where the issue type needs
escaping, otherwise you get 400 Bad Request when trying to create an
issue for an issuetype that has a space in.
  • Loading branch information
mivok authored and coryb committed Oct 28, 2017
1 parent e6600cf commit 7bfa241
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (j *Jira) GetIssueCreateMetaIssueType(projectKey, issueTypeName string) (*j
}

func GetIssueCreateMetaIssueType(ua HttpClient, endpoint string, projectKey, issueTypeName string) (*jiradata.IssueType, error) {
uri := fmt.Sprintf("%s/rest/api/2/issue/createmeta?projectKeys=%s&issuetypeNames=%s&expand=projects.issuetypes.fields", endpoint, projectKey, issueTypeName)
uri := fmt.Sprintf("%s/rest/api/2/issue/createmeta?projectKeys=%s&issuetypeNames=%s&expand=projects.issuetypes.fields", endpoint, projectKey, url.QueryEscape(issueTypeName))
resp, err := ua.GetJSON(uri)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7bfa241

Please sign in to comment.