diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index ed7461bbc66..5bff9e67f34 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -784,6 +784,14 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles ctx.Data[ctxDataKey] = template.Content if template.Type() == api.IssueTemplateTypeYaml { + // Replace field default values by values from query + for _, field := range template.Fields { + fieldValue := ctx.FormString("field:" + field.ID) + if fieldValue != "" { + field.Attributes["value"] = fieldValue + } + } + ctx.Data["Fields"] = template.Fields ctx.Data["TemplateFile"] = template.FileName }