Skip to content

fix: handle currentUser assignee filter correctly in JQL#13

Merged
pchuri merged 1 commit intomainfrom
fix/currentuser-assignee-filter
Dec 10, 2025
Merged

fix: handle currentUser assignee filter correctly in JQL#13
pchuri merged 1 commit intomainfrom
fix/currentuser-assignee-filter

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented Dec 10, 2025

📋 Summary

Fixed a bug where --assignee=currentUser filter was showing issues assigned to all users instead of only the current user. The issue was that the JQL builder was incorrectly wrapping currentUser in quotes, treating it as a literal string instead of a JIRA function.

🎯 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧪 Test improvements
  • 🔧 Code refactoring
  • ⚡ Performance improvements

🔍 Changes Made

  • Modified buildJQL() in lib/utils.js to detect currentUser value and convert it to currentUser() function call
  • Added 6 comprehensive test cases for buildJQL() function in tests/utils.test.js
  • Tests cover: project filter, currentUser assignee, specific user assignee, status filter, multiple filters, and default behavior

🧪 Testing

  • All existing tests pass
  • New tests added for new functionality
  • Manual testing completed
  • Code coverage maintained/improved

📊 Test Results

Test Suites: 7 passed, 7 total
Tests:       93 passed, 93 total
Snapshots:   0 total
Time:        0.285 s

🚀 Deployment Notes

  • No special deployment steps required
  • Requires environment variable changes
  • Requires dependency updates
  • Other:

📝 Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

💬 Additional Notes

Before:

jira issue list --assignee=currentUser
# Generated JQL: assignee = "currentUser"
# Result: Shows all issues (incorrect)

After:

jira issue list --assignee=currentUser
# Generated JQL: assignee = currentUser()
# Result: Shows only current user's issues (correct)

The buildJQL function was incorrectly wrapping the currentUser value
in quotes, causing it to be treated as a literal string instead of
a JIRA function. This resulted in showing issues assigned to all users
instead of only the current user.

Changes:
- Modified buildJQL to detect 'currentUser' and convert to currentUser()
- Added comprehensive tests for buildJQL function
- All 93 tests passing
@pchuri pchuri requested a review from Copilot December 10, 2025 04:23
@pchuri pchuri self-assigned this Dec 10, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the JQL query builder where the --assignee=currentUser filter was incorrectly treated as a literal string instead of a JIRA function, causing it to return all issues rather than only the current user's issues.

Key Changes:

  • Modified the buildJQL() function to detect currentUser and convert it to the proper currentUser() function call syntax
  • Added comprehensive test coverage for the buildJQL() function with 6 test cases covering various filter scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/utils.js Updated assignee filter logic to handle currentUser as a JIRA function instead of a quoted string
tests/utils.test.js Added test suite for buildJQL() with cases for project, assignee (both currentUser and specific user), status, multiple filters, and default behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pchuri pchuri merged commit 91b1306 into main Dec 10, 2025
5 checks passed
@pchuri pchuri deleted the fix/currentuser-assignee-filter branch December 10, 2025 04:27
github-actions bot pushed a commit that referenced this pull request Dec 10, 2025
## [2.1.1](v2.1.0...v2.1.1) (2025-12-10)

### Bug Fixes

* handle currentUser assignee filter correctly in JQL ([#13](#13)) ([91b1306](91b1306))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

2 participants