{"record":{"id":"8da27449986362f0","repo":"wtfutil/wtf","slug":"failed-to-parse-issue-s-v","errorCode":null,"errorMessage":"failed to parse issue %s: %v","messagePattern":"failed to parse issue (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/jira/client.go","lineNumber":273,"sourceCode":"\t\t\tcontinue\n\t\t}\n\t\tsearchResult.Issues = append(searchResult.Issues, *fullIssue)\n\t}\n\n\treturn searchResult, nil\n} // getIssueByID fetches full issue details by ID\nfunc (widget *Widget) getIssueByID(issueID string) (*Issue, error) {\n\turl := fmt.Sprintf(\"/rest/api/3/issue/%s\", issueID)\n\n\tresp, err := widget.jiraRequest(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tissue := &Issue{}\n\terr = utils.ParseJSON(issue, bytes.NewReader(resp))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse issue %s: %v\", issueID, err)\n\t}\n\n\treturn issue, nil\n}\n\nfunc buildJql(key string, value string) string {\n\treturn fmt.Sprintf(\"%s = \\\"%s\\\"\", key, value)\n}\n\n/* -------------------- Unexported Functions -------------------- */\n\nfunc (widget *Widget) jiraRequest(path string) ([]byte, error) {\n\turl := fmt.Sprintf(\"%s%s\", widget.settings.domain, path)\n\n\treq, err := http.NewRequest(\"GET\", url, http.NoBody)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/jira/client.go#L255-L291","documentation":"getIssueByID fails with this error when the individual issue fetched from Jira cannot be parsed into the Issue struct via utils.ParseJSON. The issue ID is included so the failing record is identifiable. Like error 78, the HTTP request succeeded but the payload doesn't fit the expected struct.","triggerScenarios":"The issue endpoint returns a body whose fields don't match the Issue struct (missing/renamed keys, unexpected types), or an HTML/error page is returned instead of issue JSON.","commonSituations":"Jira issue containing custom fields with unexpected shapes, deprecated field names after a Jira Cloud API update, proxy/SSO page injection, issues with null values where the struct expects objects.","solutions":["Log the raw body for the failing issue ID to see the mismatch","Update the Issue struct's JSON tags to match the current Jira API v3 issue payload","Make brittle fields nullable/omitempty and tolerate nulls in parsing","Check whether an intermediary (proxy/SSO) is rewriting the response"],"exampleFix":"// before\ntype Issue struct {\n    Assignee struct{ Name string `json:\"name\"` } `json:\"assignee\"` // removed field\n}\n// after\ntype Issue struct {\n    Assignee *struct {\n        AccountID string `json:\"accountId\"`\n    } `json:\"assignee\"` // nullable pointer, current field\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func looksLikeIssue(body []byte) bool {\n    var probe struct {\n        ID   string          `json:\"id\"`\n        Key  string          `json:\"key\"`\n        Fields json.RawMessage `json:\"fields\"`\n    }\n    return json.Unmarshal(body, &probe) == nil && probe.Key != \"\"\n}","tryCatchPattern":"issue, err := widget.getIssueByID(ctx, issueID)\nif err != nil {\n    if strings.Contains(err.Error(), \"failed to parse issue\") {\n        log.Printf(\"issue %s payload not parseable - check schema/custom fields: %v\", issueID, err)\n    }\n    return err\n}","preventionTips":["Keep the Issue struct's tags in sync with Jira API v3 issue payloads","Model custom fields as json.RawMessage to avoid type mismatches","Use pointers for nullable fields (assignee, resolution) so nulls parse","Test parsing against a representative sample of real issues, including ones with custom fields"],"tags":["json","parsing","jira","go"],"backgroundTag":"json-unmarshal-failed","analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}