{"record":{"id":"2047dcfeac0b7fa5","repo":"wtfutil/wtf","slug":"no-conversion-result-for-username-s","errorCode":null,"errorMessage":"no conversion result for username: %s","messagePattern":"no conversion result for username: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/jira/client.go","lineNumber":140,"sourceCode":"\tjsonData, err := json.Marshal(requestBody)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to marshal request: %v\", err)\n\t}\n\n\t// Make the POST request to the JQL conversion API\n\tresp, err := widget.jiraPostRequest(\"/rest/api/3/jql/pdcleaner\", jsonData)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar conversionResult JQLConversionResponse\n\terr = utils.ParseJSON(&conversionResult, bytes.NewReader(resp))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(conversionResult.QueryStrings) == 0 {\n\t\treturn \"\", fmt.Errorf(\"no conversion result for username: %s\", username)\n\t}\n\n\t// Return the converted JQL query part (just the assignee part)\n\tconvertedQuery := conversionResult.QueryStrings[0].ConvertedQuery\n\n\t// Extract account ID properly\n\taccountID := extractAccountIDFromJQL(convertedQuery)\n\tif accountID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"failed to extract account ID from converted query: %s\", convertedQuery)\n\t}\n\n\t// Cache the result for 10 minutes\n\tuserIDCache.Set(username, accountID, 10*time.Minute)\n\n\treturn convertedQuery, nil\n}\n\n// extractAccountIDFromJQL extracts the account ID from a converted JQL query","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/jira/client.go#L122-L158","documentation":"After successfully parsing the pdcleaner response, ConvertJQLWithUsername requires at least one entry in conversionResult.QueryStrings. If Jira returns a 200 with an empty conversion list, there is no converted JQL to use, so the library fails with the username in the message. It usually means Jira could not map the username to an account.","triggerScenarios":"The Jira account ID lookup returns successfully but the queryStrings array is empty - typically when the username doesn't match any user, or the API token lacks permission to resolve that user.","commonSituations":"Username contains a display name instead of the actual account identifier, the user was deactivated in Jira Cloud, the API token's site lacks access to that user, or Jira changed pdcleaner response semantics after a API version change.","solutions":["Verify the username exists and is active in the Jira Cloud site","Use the Jira user's account_id or exact username as configured in the widget settings","Check the Jira API token permissions for the site","Clear the userIDCache and retry after fixing the username"],"exampleFix":"# widget config\n# before\nusername: John Doe\n# after\nusername: jdoe@example.com","handlingStrategy":"validation","validationCode":"// pre-check the username is a plausible Jira identifier before conversion\nif username == \"\" || strings.ContainsAny(username, \" \") && !strings.Contains(username, \"@\") {\n    return fmt.Errorf(\"username %q unlikely to resolve; use email or exact username\", username)\n}","typeGuard":null,"tryCatchPattern":"query, err := widget.ConvertJQLWithUsername(username)\nif err != nil {\n    if strings.Contains(err.Error(), \"no conversion result\") {\n        log.Printf(\"user %q not resolvable in Jira - check account status/permissions\", username)\n    }\n    return err\n}","preventionTips":["Configure the exact Jira username or account_id, not a display name","Confirm the user is active in the target Jira Cloud site","Ensure the API token's site has access to that user","Invalidate the userIDCache after fixing user config"],"tags":["jira","api","go","empty-response"],"backgroundTag":"empty-api-response","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"}