Skip to content

Conversation

@jjshanks
Copy link

@jjshanks jjshanks commented Sep 5, 2025

Description

This PR fixes the jira_get_sprint_issues MCP tool to properly respect the fields parameter, preventing excessive context usage from returning all custom
fields regardless of the parameter value.

Root Cause: The method calculated fields_param correctly but never passed it to the underlying self.jira.get_sprint_issues() call, which doesn't support a
fields parameter in the external atlassian library.

Solution: Replace the direct API call with self.search_issues() using JQL sprint = {sprint_id}, which properly supports field filtering.

Fixes: #587

Changes

  • Modified get_sprint_issues method in src/mcp_atlassian/jira/search.py to use JQL search instead of direct API call
  • Updated existing tests to work with the new implementation (mocking search_issues instead of jira.get_sprint_issues)
  • Added new test test_get_sprint_issues_with_fields_parameter to verify fields parameter works correctly
  • Simplified error handling to be consistent with the new implementation

Testing

  • Unit tests added/updated
  • Integration tests passed
  • Manual checks performed: Built and run locally, verified new results don't eat all the context when using specific fields parameter

Checklist

  • Code follows project style guidelines (linting passes).
  • Tests added/updated for changes.
  • All tests pass locally.
  • Documentation updated (if needed).

The jira_get_sprint_issues MCP tool was ignoring the fields parameter,
returning all custom fields and causing excessive context usage.

Root cause: The method calculated fields_param but never passed it to
the underlying self.jira.get_sprint_issues() call, which doesn't support
a fields parameter in the external atlassian library.

Solution: Replace direct API call with self.search_issues() using JQL
'sprint = {sprint_id}', which properly supports field filtering.

Changes:
- Modified get_sprint_issues to use JQL search instead of direct API call
- Updated existing tests to work with new implementation
- Added test to verify fields parameter works correctly

Benefits:
- Properly respects fields parameter
- Reduces data transfer and token usage
- Consistent with other methods like get_board_issues
- No breaking API changes
@SharkyND
Copy link

Hey @jjshanks, thanks for your contribution! Since the original project is no longer actively maintained, we encourage you to move this PR to our active fork.

I have a few friends and colleagues helping maintain this fork, and we urge everyone in the community who can't use the Atlassian cloud offering MCP (https://www.atlassian.com/blog/announcements/remote-mcp-server) to help us maintain this version.

For our version mcp-atlassian we already have or are about to add:

  • Dynamic Headers that works with SSE/HTTP-Stream - Done
  • Dynamic and scalable Helm chart - Done (we are using it in production at scale)
  • Adding Bitbucket tools as a client too - In Progress (PR #7)

We have a few more ideas and would love if you can add them to the discussions there. Also would love if you can try it out and help build this with us!

Thanks!

@github-actions
Copy link

github-actions bot commented Oct 7, 2025

This pull request has been automatically marked as stale because it has not had recent activity for 14 days. It will be closed if no further activity occurs. Please leave a comment or remove the 'stale' label if you believe this PR is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 7, 2025
@Kirow
Copy link

Kirow commented Oct 13, 2025

Can anyone merge field filtering to the main repo? I'm currently having problem with the context size because of it. And I use it via Docker MCP toolkit, so I'd like to have it fixed in this repository, rather than making fork and fill-in another MCP config.

@github-actions github-actions bot removed the stale label Oct 15, 2025
nszceta added a commit to nszceta/mcp-atlassian that referenced this pull request Oct 16, 2025
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity for 14 days. It will be closed if no further activity occurs. Please leave a comment or remove the 'stale' label if you believe this PR is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants