Skip to content

Commit

Permalink
Issues: support setting issue template field values with query (go-gi…
Browse files Browse the repository at this point in the history
  • Loading branch information
techknowlogick authored Jan 30, 2023
1 parent d0d257b commit 203681d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 203681d

Please sign in to comment.