From 0b6dbf99b177090baaa132bb7851c9feb5eff2cd Mon Sep 17 00:00:00 2001 From: Xavier Jannin Date: Sun, 1 Aug 2021 23:19:57 +0200 Subject: [PATCH] fix(issuetype): fix when issue type's name has a translation When an issue type has a translation on its name (in 'Jira Administation / Issues / Issue types' - 'Translate' Action), the request 'GET .../createmeta' returns data about the issue type only when 'issuetypeNames' contains the original name, whereas in the response 'issueType.Name' includes its translation. As a result, 'issuetypeName' could not be found in the response. Solution : removing 'issuetypeNames' parameter to get every issue types from the project. --- issue.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/issue.go b/issue.go index d36ad27a..6a14ffd1 100644 --- a/issue.go +++ b/issue.go @@ -283,7 +283,7 @@ func (j *Jira) GetIssueCreateMetaIssueType(projectKey, issueTypeName string) (*j func GetIssueCreateMetaIssueType(ua HttpClient, endpoint string, projectKey, issueTypeName string) (*jiradata.IssueType, error) { uri := URLJoin(endpoint, "rest/api/2/issue/createmeta") - uri += fmt.Sprintf("?projectKeys=%s&issuetypeNames=%s&expand=projects.issuetypes.fields", projectKey, url.QueryEscape(issueTypeName)) + uri += fmt.Sprintf("?projectKeys=%s&expand=projects.issuetypes.fields", projectKey) resp, err := ua.GetJSON(uri) if err != nil { return nil, err