Conversation
- Use cursor-based pagination (nextPageToken/isLast) matching Jira's /search/jql endpoint instead of the deprecated offset-based approach - Add SearchPage() for single-page fetches with pagination metadata - Add JQLSearchResult type for the cursor-based /search/jql response - Add ListSearchFields (excludes description) for compact list output - Default page size 25, with --next-page-token for subsequent pages - Add --full flag to include all fields when needed - JSON output always wrapped with pagination metadata - Reduces typical list output from ~746K to ~43K characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
issues listandissues searchnow return a single page of results (default 25) with cursor-based pagination metadata, instead of fetching all matching issues at once--fullflag: Opt-in to include all fields (description, reporter, components, parent) when needed--next-page-tokenflag: Fetch subsequent pages using the cursor token from the previous responseDetails
The Jira
/search/jqlendpoint uses cursor-based pagination (nextPageToken/isLast), not offset-based. UpdatedSearch()andSearchAll()to use cursor-based pagination, and added a newSearchPage()method that returns a single page with pagination metadata.New types:
JQLSearchResult,SearchPageOptions,PaginatedIssues,PaginationInfo. The existingSearchResulttype (used by the Agile API) is unchanged.Test plan
go build ./...go test ./...jtk issues list --project MON --output json— returns page of 25, no description, with pagination metadatajtk issues list --project MON --next-page-token <token>— fetches next pagejtk issues list --project MON --full --max 5 --output json— includes descriptionjtk issues search --jql "project = MON" --output json— same pagination behavior