mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Issues: support setting issue template field values with query (#22545)
This commit is contained in:
		@@ -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
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user