Skip to content

Commit c7a1a95

Browse files
committed
Issues: support setting issue template field values with query
In Blender this is used to report a bug from inside the application, with some fields automatically filled in.
1 parent 5ff037e commit c7a1a95

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

routers/web/repo/issue.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,14 @@ func setTemplateIfExists(ctx *context.Context, ctxDataKey string, possibleFiles
783783
ctx.Data[ctxDataKey] = template.Content
784784

785785
if template.Type() == api.IssueTemplateTypeYaml {
786+
// Replace field default values by values from query
787+
for _, field := range template.Fields {
788+
fieldValue := ctx.FormString("field:" + field.ID)
789+
if fieldValue != "" {
790+
field.Attributes["value"] = fieldValue
791+
}
792+
}
793+
786794
ctx.Data["Fields"] = template.Fields
787795
ctx.Data["TemplateFile"] = template.FileName
788796
}

0 commit comments

Comments
 (0)