wtfutil/wtf · error

no conversion result for username: %s

Error message

no conversion result for username: %s

What it means

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.

Source

Thrown at modules/jira/client.go:140

	jsonData, err := json.Marshal(requestBody)
	if err != nil {
		return "", fmt.Errorf("failed to marshal request: %v", err)
	}

	// Make the POST request to the JQL conversion API
	resp, err := widget.jiraPostRequest("/rest/api/3/jql/pdcleaner", jsonData)
	if err != nil {
		return "", err
	}

	var conversionResult JQLConversionResponse
	err = utils.ParseJSON(&conversionResult, bytes.NewReader(resp))
	if err != nil {
		return "", err
	}

	if len(conversionResult.QueryStrings) == 0 {
		return "", fmt.Errorf("no conversion result for username: %s", username)
	}

	// Return the converted JQL query part (just the assignee part)
	convertedQuery := conversionResult.QueryStrings[0].ConvertedQuery

	// Extract account ID properly
	accountID := extractAccountIDFromJQL(convertedQuery)
	if accountID == "" {
		return "", fmt.Errorf("failed to extract account ID from converted query: %s", convertedQuery)
	}

	// Cache the result for 10 minutes
	userIDCache.Set(username, accountID, 10*time.Minute)

	return convertedQuery, nil
}

// extractAccountIDFromJQL extracts the account ID from a converted JQL query

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. Verify the username exists and is active in the Jira Cloud site
  2. Use the Jira user's account_id or exact username as configured in the widget settings
  3. Check the Jira API token permissions for the site
  4. Clear the userIDCache and retry after fixing the username

Example fix

# widget config
# before
username: John Doe
# after
username: jdoe@example.com
Defensive patterns

Strategy: validation

Validate before calling

// pre-check the username is a plausible Jira identifier before conversion
if username == "" || strings.ContainsAny(username, " ") && !strings.Contains(username, "@") {
    return fmt.Errorf("username %q unlikely to resolve; use email or exact username", username)
}

Try / catch

query, err := widget.ConvertJQLWithUsername(username)
if err != nil {
    if strings.Contains(err.Error(), "no conversion result") {
        log.Printf("user %q not resolvable in Jira - check account status/permissions", username)
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "empty response", "returned no data", "empty embeddings": what HTTP 200-with-empty-body errors mean across libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/2047dcfeac0b7fa5. Report an issue: GitHub.