{"record":{"id":"b3dfb9d442bb28a1","repo":"projectdiscovery/nuclei","slug":"failed-to-parse-template-w","errorCode":null,"errorMessage":"failed to parse template: %w","messagePattern":"failed to parse template: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/reporting/trackers/jira/jira.go","lineNumber":89,"sourceCode":"\n\t// Create template with useful functions for JIRA custom fields\n\tfuncMap := template.FuncMap{\n\t\t\"upper\":     strings.ToUpper,\n\t\t\"lower\":     strings.ToLower,\n\t\t\"title\":     cases.Title(language.English).String,\n\t\t\"contains\":  strings.Contains,\n\t\t\"hasPrefix\": strings.HasPrefix,\n\t\t\"hasSuffix\": strings.HasSuffix,\n\t\t\"trim\":      strings.Trim,\n\t\t\"trimSpace\": strings.TrimSpace,\n\t\t\"replace\":   strings.ReplaceAll,\n\t\t\"split\":     strings.Split,\n\t\t\"join\":      strings.Join,\n\t}\n\n\ttmpl, err := template.New(\"field\").Funcs(funcMap).Parse(templateStr)\n\tif err != nil {\n\t\treturn templateStr, fmt.Errorf(\"failed to parse template: %w\", err)\n\t}\n\n\tvar buf bytes.Buffer\n\tif err := tmpl.Execute(&buf, ctx); err != nil {\n\t\treturn templateStr, fmt.Errorf(\"failed to execute template: %w\", err)\n\t}\n\n\treturn buf.String(), nil\n}\n\n// evaluateCustomFieldValue evaluates a custom field value, supporting both new template syntax and legacy $variable syntax\nfunc (i *Integration) evaluateCustomFieldValue(value string, templateCtx *TemplateContext, event *output.ResultEvent) (interface{}, error) {\n\t// Try template evaluation first (supports {{...}} syntax)\n\tif strings.Contains(value, \"{{\") {\n\t\treturn evaluateTemplate(value, templateCtx)\n\t}\n\n\t// Handle legacy $variable syntax for backward compatibility","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/reporting/trackers/jira/jira.go#L71-L107","documentation":"Error \"failed to parse template: %w\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/reporting/trackers/jira/jira.go:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}