Skip to content

Conversation

@asood-rh
Copy link

@asood-rh asood-rh commented Dec 7, 2025

Summary

Adds a new /jira:issues-by-component command to list and analyze JIRA issues organized by component with comprehensive filtering capabilities.

Features

  • Component-wise grouping: Issues organized by JIRA component
  • Dual modes:
    • Overview mode: High-level summary of all components
    • Detail mode: Verbose issue details for a specific component
  • Time period filtering: last-week, last-2-weeks, last-month, or custom date ranges
  • User filtering: Filter by --assignee or --reporter
  • Status filtering: Focus on specific workflow states
  • Text search: Search in summary with --search, optionally include description with --search-description

Use Cases

  • Understanding component-level workload distribution
  • Finding issues by component and user assignment
  • Identifying component-specific patterns or problems
  • Sprint/release planning by component
  • Team capacity planning and workload analysis

Test Output

/jira:issues-by-component OCPBUGS last-week --component "Networking / ovn-kubernetes" --status "New" https://file.corp.redhat.com/~asood/issues-report.html

/jira:issues-by-component OCPBUGS last-week
https://file.corp.redhat.com/~asood/overview-report.md

Example Usage

# Overview of all components from last week
/jira:issues-by-component OCPBUGS last-week

# Detailed view of specific component
/jira:issues-by-component OCPBUGS --component "Cluster Version Operator"

# Filter by user and search
/jira:issues-by-component OCPBUGS last-week --assignee jsmith --search "upgrade"

# Combine all filters
/jira:issues-by-component OCPBUGS --component "Networking" --status "Open,In Progress" --search "DNS timeout" --search-description

Files Changed

- plugins/jira/commands/issues-by-component.md - New command definition
- PLUGINS.md - Updated command listing
- docs/data.json - Updated plugin metadata

Testing

- ✅ Linter validation passed
- ✅ Command structure follows existing Jira command patterns
- ✅ Plugin metadata updated automatically

🤖 Generated with https://claude.com/claude-code



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
* Added `/jira:issues-by-component` command to list and analyze JIRA issues organized by component with flexible filtering (project key, time period, component, assignee, reporter, status, and search terms).

* **Documentation**
* Added comprehensive command documentation with usage examples, argument specifications, prerequisites, and error-handling guidance.

<sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Introduces a new command to list and analyze JIRA issues organized by component
with comprehensive filtering capabilities including:

- Component-wise grouping with overview and detail modes
- Time period filtering (last-week, last-2-weeks, custom ranges)
- User filtering by assignee or reporter
- Status filtering for workflow states
- Text search in summary with optional description search
- Dual output modes: overview for all components or detailed view for specific component

This command helps with workload distribution analysis, component-specific
issue tracking, and team capacity planning.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@openshift-ci openshift-ci bot requested review from brandisher and mrunalp December 7, 2025 23:12
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: asood-rh
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 7, 2025

Walkthrough

Added a new Jira plugin command /jira:issues-by-component to list and analyze JIRA issues grouped by component, with filters for project-key, time-period, component, assignee, reporter, status, search term, and search-description; documented and registered across plugin docs and command reference.

Changes

Cohort / File(s) Summary
Jira plugin docs & registry
PLUGINS.md, docs/data.json
Added issues-by-component command declaration and synopsis with argument hints and description supporting <project-key> [time-period] [--component name] [--assignee username] [--reporter username] [--status status] [--search term] [--search-description].
Command implementation guide
plugins/jira/commands/issues-by-component.md
New detailed command doc describing name, synopsis, prerequisites (MCP creds), argument parsing, JQL construction, curl-based Jira API fetch with pagination, Python-based grouping/aggregation by component, overview/detail modes, error cases, return files, and usage examples.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CmdProc as Command Processor
    participant MCP as MCP Config
    participant JiraAPI as Jira API
    participant Py as Python Processor
    participant Out as Markdown Report

    User->>CmdProc: Invoke /jira:issues-by-component with args
    CmdProc->>MCP: Load Jira credentials
    MCP-->>CmdProc: Return credentials
    CmdProc->>CmdProc: Parse args & build JQL (project, time, filters)
    CmdProc->>JiraAPI: curl request with JQL (paginated)
    JiraAPI-->>CmdProc: Return issue batches
    CmdProc->>Py: Send raw issue JSON batches
    Py->>Py: Group by component & aggregate stats
    Py-->>CmdProc: Grouped results / summaries
    CmdProc->>Out: Render overview or per-component detail Markdown
    Out-->>User: Present generated report
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing extra attention:
    • JQL construction to ensure correct combination of all filters (component, assignee, reporter, status, time-period, search terms)
    • Pagination and batching correctness for large result sets
    • Error handling for credential issues, authentication failures, invalid project/component, and API rate limits
    • Accuracy of Python grouping/aggregation and Markdown formatting for both overview and detail modes

Pre-merge checks and finishing touches

✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding a new jira:issues-by-component command for analyzing issues by component. It is concise, specific, and directly reflects the changeset content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
No Real People Names In Style References ✅ Passed References to 'Claude' in the new documentation are technical references to the Claude AI tool itself, not real people names used as style references, adhering to repository policy.
No Assumed Git Remote Names ✅ Passed The three modified files contain no git remote references and focus entirely on JIRA API interactions without git operations.
Git Push Safety Rules ✅ Passed Comprehensive search of all three modified PR files (PLUGINS.md, docs/data.json, plugins/jira/commands/issues-by-component.md) confirms no git push commands or git operations are present.
No Untrusted Mcp Servers ✅ Passed The PR documentation includes a JSON configuration example for an existing Atlassian MCP server but introduces no new MCP server installations or package installation instructions.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 7, 2025
@openshift-ci
Copy link

openshift-ci bot commented Dec 7, 2025

Hi @asood-rh. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
plugins/jira/commands/issues-by-component.md (2)

113-118: Resolve repetitive sentence structure in argument parsing section.

Three consecutive sentences ("Parse project key...", "Parse optional time-period...", "Parse optional flags...") begin with the same word "Parse". Restructure these sentences for better readability.

Example refactor:

-Parse project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc.
-Parse optional time-period from $2:
-  - `last-week` (default if not specified)
+Extract the project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc.

+For the optional time-period parameter ($2):
   - `last-2-weeks`
   - `last-month`
   - Custom range: `YYYY-MM-DD:YYYY-MM-DD`
-Parse optional flags:
+Handle optional filtering flags:
   - `--component <name>`: Filter to specific component (enables Detail Mode)

37-88: Clearly document the credential configuration requirement more prominently.

The credentials section (lines 37-88) is thorough but lengthy. Consider restructuring to emphasize that while this command uses curl instead of MCP, it STILL requires MCP configuration to exist. The critical point—that credentials must be in ~/.config/claude-code/mcp.json—could be stated more concisely up-front.

The explanation of "why not use MCP commands" (lines 49-53) is good for context, but recommend pulling the core requirement to the start of the Prerequisites section:

 ## Prerequisites

+**⚠️ IMPORTANT:** This command requires JIRA credentials configured in `~/.config/claude-code/mcp.json`, even though it uses `curl` instead of MCP commands for performance reasons.
+
 This command requires JIRA credentials to be configured via the JIRA MCP server setup...
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between bc9efa5 and 7af4fc4.

📒 Files selected for processing (3)
  • PLUGINS.md (1 hunks)
  • docs/data.json (1 hunks)
  • plugins/jira/commands/issues-by-component.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/jira/commands/issues-by-component.md

[style] ~114-~114: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...red): "OCPBUGS", "JIRA", "HYPE", etc. - Parse optional time-period from $2: - `last...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 markdownlint-cli2 (0.18.1)
plugins/jira/commands/issues-by-component.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


486-486: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


497-497: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


509-509: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


523-523: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


557-557: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


563-563: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


569-569: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


575-575: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


583-583: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


589-589: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


595-595: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


601-601: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


609-609: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


615-615: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


621-621: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
PLUGINS.md (1)

161-161: Command documentation entry is consistent and complete.

The new command entry follows the established format for Jira plugin commands, with proper command signature, filters, and description.

docs/data.json (1)

111-116: JSON command declaration is properly structured and positioned.

The new command entry follows the same format as other Jira commands, maintains alphabetical ordering within the commands array, and includes all required fields with consistent syntax.

Comment on lines +10 to +12
```
/jira:issues-by-component <project-key> [time-period] [--component component-name] [--assignee username] [--reporter username] [--status status] [--search search-term] [--search-description]
```
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 7, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add language specifiers to all fenced code blocks to comply with Markdown standards.

Multiple code blocks throughout the document lack language specifications, which violates markdownlint standards and reduces syntax highlighting for readers. Identify all fenced code blocks and add appropriate language identifiers:

  • Bash/shell commands: ```bash
  • Python code: ```python
  • JSON data: ```json
  • JQL queries: ```jql (or ```sql as fallback)
  • Markdown output examples: ```markdown

This affects approximately 15 code blocks across the document (lines ~10, ~98, ~134, ~196, ~260, ~371, ~486, ~497, ~509, ~523, ~557, ~563, ~569, ~575, ~601, ~609, ~615, ~621).

Example fix for line 10 (bash block):

-```
+```bash
 /jira:issues-by-component <project-key> [time-period] [--component component-name] [--assignee username] [--reporter username] [--status status] [--search search-term] [--search-description]
-```
+```

Apply similar fixes to all other fenced code blocks in the document.

Also applies to: 98-108, 134-173, 196-243, 260-351, 371-468, 557-625

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

Copy link
Author

Choose a reason for hiding this comment

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

@coderabbitai User does not need to run the command as bash command. This is claude command.
I do not think language specifier is needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@asood-rh You're absolutely right! The command synopsis at line 10 is indeed a Claude command invocation format, not a bash command. I should not have suggested bash as the language identifier for that block.

For the command synopsis itself, you could either:

  • Leave it without a language specifier (as you prefer)
  • Use a generic identifier like text if you want to suppress the linter warning

However, if there are other code blocks in the full document that contain actual bash/shell scripts, Python code, JSON examples, or JQL queries (which the markdownlint report suggests exist at various lines), those specific blocks might still benefit from appropriate language identifiers for better syntax highlighting and readability. But I understand if you prefer to keep the documentation style consistent without language specifiers throughout.

I'll defer to your judgment on the documentation style for this command!

@asood-rh
Copy link
Author

asood-rh commented Dec 9, 2025

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 9, 2025
@asood-rh
Copy link
Author

@LiangquanLi930 Would you be able to review this PR?

Comment on lines 260 to 287
```python
import json
import glob
import sys
from collections import defaultdict
from datetime import datetime

# Parse command-line arguments
search_terms = sys.argv[1] if len(sys.argv) > 1 else None
search_description = sys.argv[2] == "true" if len(sys.argv) > 2 else False

# Load all batches
all_issues = []
for batch_file in sorted(glob.glob('.work/jira-issues-by-component/{project-key}/batch-*.json')):
with open(batch_file) as f:
data = json.load(f)
all_issues.extend(data['issues'])

# Apply text search filter if provided
if search_terms:
keywords = [k.strip().lower() for k in search_terms.replace(',', ' ').split()]
filtered_issues = []

for issue in all_issues:
summary = issue['fields'].get('summary', '').lower()
description = issue['fields'].get('description', '').lower() if search_description else ''

# Check if any keyword matches
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don’t need any Python code, we should use the JIRA MCP.

Copy link
Author

@asood-rh asood-rh Dec 11, 2025

Choose a reason for hiding this comment

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

Sure, I tested the command does work without using intermediate python code. I used personal token from JIRA to test out. It is indicated just need JIRA personal token and email address in mcp json. Need to confirm if MCP server is used while processing the command or not.

Copy link
Author

Choose a reason for hiding this comment

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

@LiangquanLi930 Thanks for reviewing. Makes sense for removing python code reference. Use of API versus MCP is transparent to user.

Let me know if the commit needs to be squashed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (4)
plugins/jira/commands/issues-by-component.md (4)

61-76: Add language specifier to JSON configuration example.

This block contains actual JSON configuration, which would benefit from syntax highlighting and language specification for readability.

Apply this diff:

-```json
+```json
 {
   "mcpServers": {
     "atlassian": {

This ensures proper syntax highlighting without being a Claude command invocation (which correctly has no specifier per your preference).


98-108: Add language specifier to bash credential extraction code block.

This block contains actual bash/shell commands and would benefit from syntax highlighting. Note: this is executable shell code, not a Claude command invocation.

Apply this diff:

-```bash
+```bash
   MCP_CONFIG="$HOME/.config/claude-code/mcp.json"
 
   JIRA_URL=$(jq -r '.mcpServers.atlassian.env.JIRA_URL' "$MCP_CONFIG")

This maintains clarity for readers without affecting Claude command formatting (which you correctly prefer without specifiers).


196-243: Add language specifier to bash batch processing loop.

This is the longest and most complex bash code block in the documentation. Adding a bash language specifier will improve syntax highlighting and readability without affecting the Claude command invocation examples elsewhere.

Apply this diff:

-```bash
+```bash
 START_AT=0
 BATCH_NUM=0
 TOTAL_FETCHED=0

This block is actual shell code (not a Claude command), so a language specifier is appropriate.


113-119: Vary sentence structure to reduce repetition.

Three consecutive sentences begin with "Parse," which impacts readability. The LanguageTool hint is valid here.

Apply this diff to improve variety:

- Parse project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc.
- Parse optional time-period from $2:
+ Extract the project key from $1 (required): "OCPBUGS", "JIRA", "HYPE", etc.
+ The optional time-period argument ($2) accepts:
   - `last-week` (default if not specified)
   - `last-2-weeks`
   - `last-month`
   - Custom range: `YYYY-MM-DD:YYYY-MM-DD`
- Parse optional flags:
+ Handle optional flag arguments as follows:

This maintains clarity while reducing successive sentence repetition.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 7af4fc4 and c901769.

📒 Files selected for processing (1)
  • plugins/jira/commands/issues-by-component.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
plugins/jira/commands/issues-by-component.md

[style] ~114-~114: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...red): "OCPBUGS", "JIRA", "HYPE", etc. - Parse optional time-period from $2: - `last...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🪛 markdownlint-cli2 (0.18.1)
plugins/jira/commands/issues-by-component.md

10-10: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


374-374: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


385-385: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


397-397: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


411-411: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


445-445: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


451-451: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


457-457: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


463-463: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


471-471: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


477-477: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


483-483: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


489-489: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


497-497: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


503-503: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


509-509: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (5)
plugins/jira/commands/issues-by-component.md (5)

1-12: Documentation structure is clear and well-organized.

The frontmatter metadata and synopsis provide good orientation. The frontmatter description and argument-hint are concise and actionable. However, note that the synopsis block (lines 10-12) is a Claude command invocation format (not bash), so per your earlier feedback, no language specifier is appropriate here.

Verify that the command syntax in the synopsis matches the implementation (argument parsing section in the Implementation part). For example, confirm that the argument order and optional flags are correctly documented.


371-420: Error handling section is comprehensive.

The error handling covers all major failure modes: missing credentials, invalid credentials, authentication failures, invalid inputs, missing components, and API rate limiting. The error messages are clear and helpful to users.

Consider adding language specifiers (text or console) to the error output blocks (lines 374, 385, 397, 411) for consistency with the code blocks in the implementation section, though this is optional and not critical.


37-56: Clarify Python processing requirement.

The prerequisites section states "uses curl to fetch data directly from JIRA and save to disk, then processes it with Python" (line 55), but an earlier review comment from asood-rh indicated testing without intermediate Python code. This creates potential ambiguity.

Please clarify:

  1. Is Python processing mandatory for the command to function?
  2. Or is Python optional (with fallback bash-only processing)?
  3. If Python is required, should this be listed as a prerequisite tool?

If the command has been tested and works without Python, consider revising line 55 to reflect this, or ensure Python is explicitly listed as a system dependency alongside jq and curl.


438-512: Examples section is comprehensive and well-organized.

The examples progressively demonstrate the command from basic usage through advanced scenarios. The progression (overview → detail → advanced) makes it easy for users to understand capabilities. The examples correctly use the Claude command invocation format without language specifiers, consistent with your documented preference.


14-35: Description and feature overview are clear.

The description clearly explains the command's purpose, the two modes of operation (overview vs. detail), and the use cases. The feature list is well-organized and easy to scan. This sets good expectations for users.

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

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants