Skip to content

Add --category filter to project:issues for filtering by issue type#328

Merged
mglaman merged 3 commits intomainfrom
copilot/allow-specifying-issue-type
Mar 24, 2026
Merged

Add --category filter to project:issues for filtering by issue type#328
mglaman merged 3 commits intomainfrom
copilot/allow-specifying-issue-type

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

project:issues only supported filtering by workflow status (RTBC, needs review, etc.) with no way to scope by issue type (bug, task, feature request, support, plan), limiting common workflows like triaging open bugs or auditing support queue.

Changes

  • New ProjectIssueCategory enum — string-backed (bug, task, feature, support, plan) with a categoryId() method mapping to Drupal.org's field_issue_category integer values (1–5)
  • GetProjectIssuesAction — accepts optional ?ProjectIssueCategory $category; adds field_issue_category to the API query only when set (backwards-compatible)
  • project:issues command — new --category option forwarded to the action
  • ToolRegistry::projectGetIssues() — optional $category string parameter with enum annotation for MCP tooling

Usage

# All open bug reports
drupalorg project:issues token --category=bug

# Open support requests
drupalorg project:issues drupal --category=support --limit=50
Original prompt

This section details on the original issue you should resolve

<issue_title>allow specifying issue type when getting project issues</issue_title>
<issue_description>Right now project issues can only be fetched by status. There should be a way to get all support, bugs, tasks, etc.

Docs: https://www.drupal.org/drupalorg/docs/apis/rest-and-other-apis

field_issue_category is the field for the issue type
1 = Bug report
2 = Task
3 = Feature request
4 = Support request
5 = Plan

Use case:

  • find all open support issues or find all open/closed support issues to find common problems that could be documented.
  • Find all open bug tickets to work on</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add functionality to specify issue type when fetching project issues Add --category filter to project:issues for filtering by issue type Mar 23, 2026
Copilot AI requested a review from mglaman March 23, 2026 13:51
@mglaman
Copy link
Owner

mglaman commented Mar 23, 2026

@copilot should we update the generic drupalorg-cli skill and any other docs to explain this new flag

Copy link
Contributor Author

Copilot AI commented Mar 23, 2026

@copilot should we update the generic drupalorg-cli skill and any other docs to explain this new flag

Updated skills/drupalorg-cli/SKILL.md in a86e308 — the project:issues entry now documents --category with its accepted values (bug, task, feature, support, plan) and also corrects the listed type values to include review.

Copy link
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

Adds an optional issue-category filter to the project issues listing flow, enabling users (and MCP tooling) to scope results by Drupal.org issue type (bug/task/feature/support/plan) while keeping existing status-based filtering intact.

Changes:

  • Introduces ProjectIssueCategory enum with a Drupal.org field_issue_category ID mapper.
  • Extends GetProjectIssuesAction (and callers) to optionally add field_issue_category to the API query.
  • Adds --category to project:issues and exposes an optional category parameter via MCP ToolRegistry.

Reviewed changes

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

Show a summary per file
File Description
tests/src/Action/Project/GetProjectIssuesActionTest.php Adds coverage to assert the category parameter is included/omitted in the issue query params.
src/Cli/Command/Project/ProjectIssues.php Adds --category CLI option and forwards it to the action via the new enum.
src/Api/Mcp/ToolRegistry.php Extends MCP project_get_issues tool with an optional category argument and enum conversion.
src/Api/Enum/ProjectIssueCategory.php New enum representing issue categories and mapping them to Drupal.org numeric IDs.
src/Api/Action/Project/GetProjectIssuesAction.php Accepts optional category and conditionally adds field_issue_category to the REST request params.
skills/drupalorg-cli/SKILL.md Documents --category usage for project:issues in the agent skill docs.

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

@mglaman mglaman marked this pull request as ready for review March 24, 2026 15:45
@mglaman mglaman merged commit c77961c into main Mar 24, 2026
13 checks passed
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.

allow specifying issue type when getting project issues

3 participants