Skip to content

maxResults=5000 in sprints_by_name() still returns only 50 sprints #2395

@Akash-kansal

Description

@Akash-kansal

Bug summary

Code Snippet

def sprints_by_name(self, board_id: int, sprint_name: str) -> str:
    """
    Finds a specific sprint within a board by its name.
    """
    try:
        log_info(f"Searching for sprint '{sprint_name}' in board '{board_id}'")
        sprints = self.jira.sprints(board_id, maxResults=5000)  # <-- only 50 returned

        matching_sprints = [s for s in sprints if s.name == sprint_name]

        if not matching_sprints:
            return json.dumps({"error": f"Sprint '{sprint_name}' not found in board '{board_id}'."})

        if len(matching_sprints) > 1:
            return json.dumps({"error": f"Multiple sprints found with the name '{sprint_name}'. Please use a unique name."})

        sprint = matching_sprints[0]
        sprint_details = {
            "id": sprint.id,
            "name": sprint.name,
            "state": sprint.state,
            "goal": getattr(sprint, 'goal', 'No goal set.'),
            "startDate": getattr(sprint, 'startDate', None),
            "endDate": getattr(sprint, 'endDate', None),
        }
        return json.dumps(sprint_details, default=str)
    except Exception as e:
        logger.error(f"Failed to get sprint by name: {e}")
        return json.dumps({"error": str(e)})

Steps to Reproduce

  1. Use sprints_by_name(board_id=<valid_board_id>, sprint_name=<existing_sprint_name>)
  2. The board must contain more than 50 sprints.
  3. Observe that even though maxResults=5000 is set, the API still returns only 50 sprints.

Expected Behavior

Should return up to 5000 sprints as requested (or at least respect the maxResults parameter).

Actual Behavior

Only 50 sprints are returned — the Jira API appears to enforce a pagination limit.

Only 50 sprints are returned — the Jira API appears to enforce a pagination limit.


Environment

  • Python Jira library: jira==3.10.5
  • Python version: 3.11
  • Platform: macOS
  • Jira instance: Cloud

Is there an existing issue for this?

  • I have searched the existing issues

Jira Instance type

Jira Cloud (Hosted by Atlassian)

Jira instance version

3.10.5

jira-python version

3.10.5

Python Interpreter version

3.11

Which operating systems have you used?

  • Linux
  • macOS
  • Windows

Reproduction steps

1. Use `sprints_by_name(board_id=<valid_board_id>, sprint_name=<existing_sprint_name>)`
2. The board must contain more than 50 sprints.
3. Observe that even though `maxResults=5000` is set, the API still returns only **50 sprints**.

Stack trace

Returning only 50 results

Expected behaviour

It should give max result

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions