Files
awesome-copilot/skills/github-issues/references/search.md
Tadas Labudis fca5de1f6a Improve github-issues skill: fix MCP tools, add search reference, fix sub-issues docs (#888)
* Add advanced search reference with query syntax guide

Covers search qualifiers, boolean logic, date ranges, missing metadata
filters, common patterns, and when to use search vs list_issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add issue fields search support to search and issue-fields references

- Add Advanced Search Mode section to search.md covering field: qualifier,
  has:field: syntax, REST advanced_search=true, and GraphQL ISSUE_ADVANCED
- Add Searching by Field Values section to issue-fields.md with REST/GraphQL
  examples and qualifier reference table
- Note MCP search_issues limitation (no advanced_search support)
- Update SKILL.md capability table to mention issue field filters

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Clarify three search approaches: list_issues vs search_issues vs advanced search

Replace the simple two-column comparison with a capability matrix showing
what each approach supports (field filters, boolean logic, scope, etc.)
and a decision guide for when to use each one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix issue field search syntax: use dot notation (field.name:value)

The colon notation (field:Name:Value) is silently ignored by the API.
The correct syntax is dot notation (field.priority:P0) which works in
REST (advanced_search=true), GraphQL (ISSUE_ADVANCED), and web UI.

Also supports has:field.name, no:field.name, and date comparisons.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix github-issues skill: correct MCP tools and add gh api workflows

The skill listed 5 MCP tools that don't exist (create_issue, update_issue,
get_issue, add_issue_comment, list_issue_types), causing tool-not-found
errors when agents tried to follow the skill instructions.

Changes:
- Split tools table into MCP (read ops) and CLI/API (write ops)
- Add gh api commands for creating, updating, commenting on issues
- Document that gh issue create doesn't support --type flag
- Add GraphQL query for discovering issue types
- Remove redundant [Bug]/[Feature] title prefixes (use type param instead)
- Update examples to use gh api instead of non-existent MCP tools

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix sub-issues reference: add gh api examples and integer gotcha

The sub_issue_id parameter requires an integer but gh api -f sends strings,
causing 422 errors. Updated all REST examples to use --input with raw JSON.

Also added:
- Recommended two-step workflow (create issue, then link)
- Explicit warning about -f vs --input for integer params
- Proper gh api command syntax instead of raw HTTP notation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review: fix search docs accuracy and broken link

- Fix misleading claim about full boolean logic support (implicit AND only)
- Remove sort:updated from query example (it's an API param, not a qualifier)
- Clarify -linked:pr comment to avoid confusion with authoring status
- Fix relative link in issue-fields.md (sibling file, not nested path)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve projects reference: scope warning, gh api examples, issue-side queries

From hands-on usage: hit INSUFFICIENT_SCOPES trying to update project
status because token had read:project but not project write scope.

Added:
- OAuth scope requirements table with gh auth refresh workaround
- How to find an issue's project item ID (query from issue side)
- All GraphQL examples now use gh api graphql (copy-paste ready)
- End-to-end example: set issue status to In Progress

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add images-in-issues reference: hosting methods, pitfalls, screenshots

Documents three approaches for embedding images in issue comments
via CLI: Contents API with github.com/raw/ URLs, browser drag-drop
for permanent user-attachments URLs, and gist hosting limitations.

Includes puppeteer screenshot recipe and comparison table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update README.skills.md with images reference

Run npm run build to regenerate skill listing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix issue-fields search: add GraphQL bulk query, caveat search syntax

The field.name:value search qualifier is unreliable via API (returns
0 results even when matching issues exist). Added a recommended
GraphQL approach that fetches issues and filters by issueFieldValues
client-side. Documented the correct IssueFieldSingleSelectValue
schema (name, not value). Marked search qualifier syntax as
experimental with a reliability warning.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(github-issues): improve project discovery guidance

The projectsV2 query param does keyword search, not exact match,
and sorts by recency. For large orgs like github, common words like
'issue' return 400+ results and bury the target project.

Added a priority-ordered discovery strategy:
1. Direct lookup by number (instant)
2. Reverse lookup from a known issue's projectItems (most reliable)
3. GraphQL name search with client-side jq filtering (fallback)
4. MCP tool (small orgs only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:20:36 +11:00

7.1 KiB

Advanced Issue Search

The search_issues MCP tool uses GitHub's issue search query format for cross-repo searches, supporting implicit-AND queries, date ranges, and metadata filters (but not explicit OR/NOT operators).

There are three ways to find issues, each with different capabilities:

Capability list_issues (MCP) search_issues (MCP) Advanced search (gh api)
Scope Single repo only Cross-repo, cross-org Cross-repo, cross-org
Issue field filters (field.priority:P0) No No Yes (dot notation)
Issue type filter (type:Bug) No Yes Yes
Boolean logic (AND/OR/NOT, nesting) No Yes (implicit AND only) Yes (explicit AND/OR/NOT)
Label/state/date filters Yes Yes Yes
Assignee/author/mentions No Yes Yes
Negation (-label:x, no:label) No Yes Yes
Text search (title/body/comments) No Yes Yes
since filter Yes No No
Result limit No cap (paginate all) 1,000 max 1,000 max
How to call MCP tool directly MCP tool directly gh api with advanced_search=true

Decision guide:

  • Single repo, simple filters (state, labels, recent updates): use list_issues
  • Cross-repo, text search, author/assignee, issue types: use search_issues
  • Issue field values (Priority, dates, custom fields) or complex boolean logic: use gh api with advanced_search=true

Query Syntax

The query parameter is a string of search terms and qualifiers. A space between terms is implicit AND.

Scoping

repo:owner/repo       # Single repo (auto-added if you pass owner+repo params)
org:github            # All repos in an org
user:octocat          # All repos owned by user
in:title              # Search only in title
in:body               # Search only in body
in:comments           # Search only in comments

State & Close Reason

is:open               # Open issues (auto-added: is:issue)
is:closed             # Closed issues
reason:completed      # Closed as completed
reason:"not planned"  # Closed as not planned

People

author:username       # Created by
assignee:username     # Assigned to
mentions:username     # Mentions user
commenter:username    # Has comment from
involves:username     # Author OR assignee OR mentioned OR commenter
author:@me            # Current authenticated user
team:org/team         # Team mentioned

Labels, Milestones, Projects, Types

label:"bug"                 # Has label (quote multi-word labels)
label:bug label:priority    # Has BOTH labels (AND)
label:bug,enhancement       # Has EITHER label (OR)
-label:wontfix              # Does NOT have label
milestone:"v2.0"            # In milestone
project:github/57           # In project board
type:"Bug"                  # Issue type

Missing Metadata

no:label              # No labels assigned
no:milestone          # No milestone
no:assignee           # Unassigned
no:project            # Not in any project

Dates

All date qualifiers support >, <, >=, <=, and range (..) operators with ISO 8601 format:

created:>2026-01-01              # Created after Jan 1
updated:>=2026-03-01             # Updated since Mar 1
closed:2026-01-01..2026-02-01   # Closed in January
created:<2026-01-01              # Created before Jan 1

Linked Content

linked:pr             # Issue has a linked PR
-linked:pr            # Issues not yet linked to any PR
linked:issue          # PR is linked to an issue

Numeric Filters

comments:>10          # More than 10 comments
comments:0            # No comments
interactions:>100     # Reactions + comments > 100
reactions:>50         # More than 50 reactions

Boolean Logic & Nesting

Use AND, OR, and parentheses (up to 5 levels deep, max 5 operators):

label:bug AND assignee:octocat
assignee:octocat OR assignee:hubot
(type:"Bug" AND label:P1) OR (type:"Feature" AND label:P1)
-author:app/dependabot          # Exclude bot issues

A space between terms without an explicit operator is treated as AND.

Common Query Patterns

Unassigned bugs:

repo:owner/repo type:"Bug" no:assignee is:open

Issues closed this week:

repo:owner/repo is:closed closed:>=2026-03-01

Stale open issues (no updates in 90 days):

repo:owner/repo is:open updated:<2026-01-01

Open issues without a linked PR (needs work):

repo:owner/repo is:open -linked:pr

Issues I'm involved in across an org:

org:github involves:@me is:open

High-activity issues:

repo:owner/repo is:open comments:>20

Issues by type and priority label:

repo:owner/repo type:"Epic" label:P1 is:open

Reliability warning: The field.name:value search qualifier syntax is experimental and may return 0 results even when matching issues exist. For reliable filtering by field values, use the GraphQL bulk query approach documented in issue-fields.md.

Issue fields can theoretically be searched via the field.name:value qualifier using advanced search mode. This works in the web UI but results from the API are inconsistent.

REST API

Add advanced_search=true as a query parameter:

gh api "search/issues?q=org:github+field.priority:P0+type:Epic+is:open&advanced_search=true" \
  --jq '.items[] | "#\(.number): \(.title)"'

GraphQL

Use type: ISSUE_ADVANCED instead of type: ISSUE:

{
  search(query: "org:github field.priority:P0 type:Epic is:open", type: ISSUE_ADVANCED, first: 10) {
    issueCount
    nodes {
      ... on Issue { number title }
    }
  }
}

Issue Field Qualifiers

The syntax uses dot notation with the field's slug name (lowercase, hyphens for spaces):

field.priority:P0                  # Single-select field equals value
field.priority:P1                  # Different option value
field.target-date:>=2026-04-01     # Date comparison
has:field.priority                 # Has any value set
no:field.priority                  # Has no value set

MCP limitation: The search_issues MCP tool does not pass advanced_search=true. You must use gh api directly for issue field searches.

Common Field Search Patterns

P0 epics across an org:

org:github field.priority:P0 type:Epic is:open

Issues with a target date this quarter:

org:github field.target-date:>=2026-04-01 field.target-date:<=2026-06-30 is:open

Open bugs missing priority:

org:github no:field.priority type:Bug is:open

Limitations

  • Query text: max 256 characters (excluding operators/qualifiers)
  • Boolean operators: max 5 AND/OR/NOT per query
  • Results: max 1,000 total (use list_issues if you need all issues)
  • Repo scan: searches up to 4,000 matching repositories
  • Rate limit: 30 requests/minute for authenticated search
  • Issue field search requires advanced_search=true (REST) or ISSUE_ADVANCED (GraphQL); not available through MCP search_issues