Skip to content

Conversation

@ani-sh-z
Copy link

πŸ› οΈ PR Description

This pull request updates the get_suites response handling to align with the new paginated response format introduced in TestRail 9.3.1.1020.

πŸ”„ Changes

Introduced a new Suites interface based on the latest API response:

interface Suites {
  offset: number;
  limit: number;
  size: number;
  _links: {
    next?: string | null;
    prev?: string | null;
  };
  suites: Suite[];
}

Updated the getSuites method to return the new Suites type instead of a flat array.

πŸ“š Reference

TestRail 9.3.1.1020 Release Notes:

The get_suites endpoint has been updated to support pagination.
See: TestRail API – get_suites

@dlenroc
Copy link
Owner

dlenroc commented Jul 20, 2025

Thanks for the PR!


To keep compatibility with older versions, pagination is handled via the pagination helper.

Example:

export function getCases(ctx: TestRailCtx, projectId: number, filters?: CaseFilters): Promise<Case[]> {
  return pagination('cases', filters, (filters) => {
    return _api(ctx, 'GET', `get_cases/${projectId}`, { query: filters });
  });
}

Although not ideal, this ensures compatibility with older self-hosted versions (without pagination) by automatically handling pagination in newer versions unless limit or offset are explicitly set.


I’ll open a separate PR to add pagination support for get_suites (9.3.1) and get_users endpoints.

@dlenroc
Copy link
Owner

dlenroc commented Jul 20, 2025

The issue was addressed in #77 and included in the v1.9.2 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants