Skip to content

fix: correct schema field type in JQL search responses#411

Draft
fank wants to merge 1 commit intomainfrom
fix/issue-404-jql-schema-type
Draft

fix: correct schema field type in JQL search responses#411
fank wants to merge 1 commit intomainfrom
fix/issue-404-jql-schema-type

Conversation

@fank
Copy link
Collaborator

@fank fank commented Sep 2, 2025

Summary

Problem

When fetching issues through the new JQL search endpoint with expand="schema", users received the error:

cannot unmarshal object into Go struct field IssueSearchJQLSchemeV2.schema of type string

The API returns schema as nested objects:

"schema": {
    "summary": {
        "type": "string",
        "system": "summary"
    },
    "assignee": {
        "type": "user",
        "system": "assignee"
    }
}

But the struct incorrectly expected map[string]string.

Changes

  • Added IssueFieldSchema struct with Type and System fields
  • Updated IssueSearchJQLSchemeV2.Schema to use map[string]*IssueFieldSchema
  • Updated IssueSearchJQLScheme.Schema to use map[string]*IssueFieldSchema
  • Added unit test to verify correct unmarshaling

Test plan

  • Added unit test that verifies schema unmarshaling works correctly
  • Test passes with the new struct definition
  • Manual testing with actual Jira API (requires credentials)

Fixes #404

🤖 Generated with Claude Code

The schema field in IssueSearchJQLSchemeV2 and IssueSearchJQLScheme was
incorrectly typed as map[string]string when the API actually returns a
nested structure with 'type' and 'system' fields.

This caused unmarshaling errors when using expand="schema" in JQL searches.

Changes:
- Add IssueFieldSchema struct to properly represent schema field structure
- Update IssueSearchJQLSchemeV2.Schema to use map[string]*IssueFieldSchema
- Update IssueSearchJQLScheme.Schema to use map[string]*IssueFieldSchema
- Add test to verify correct unmarshaling of schema field

Fixes #404

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@fank fank added bug Something isn't working breaking-change labels Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to "expand" schema in new JQL issue search endpoint

1 participant