issue-fields-migration by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill issue-fields-migration议题字段是组织层级的类型化元数据(单选、文本、数字、日期),它用结构化、可搜索、跨仓库的字段取代了基于标签的变通方案。每个组织都会预配置 Priority、Effort、Start date 和 Target date,最多支持 25 个自定义字段。
此技能可从两个来源批量迁移现有元数据到议题字段:
p0、p1、priority/high 等标签转换为结构化的议题字段值(例如 Priority 字段)。支持一次迁移多个标签,并可选择在迁移后移除它们。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
gh CLI 必须已通过适当范围的认证| 工具 | 用途 |
|---|---|
mcp__github__projects_list | 列出项目字段 (list_project_fields),列出带值的项目项 (list_project_items) |
mcp__github__projects_get | 获取特定项目字段或项的详细信息 |
| 操作 | 命令 |
|---|---|
| 列出组织议题字段 | gh api /orgs/{org}/issue-fields -H "X-GitHub-Api-Version: 2026-03-10" |
| 读取议题字段值 | gh api /repos/{owner}/{repo}/issues/{number}/issue-field-values -H "X-GitHub-Api-Version: 2026-03-10" |
| 写入议题字段值 | gh api /repositories/{repo_id}/issues/{number}/issue-field-values -X POST -H "X-GitHub-Api-Version: 2026-03-10" --input - |
| 获取仓库 ID | gh api /repos/{owner}/{repo} --jq .id |
| 列出仓库标签 | gh label list -R {owner}/{repo} --limit 1000 --json name,color,description |
| 按标签列出议题 | gh issue list -R {owner}/{repo} --label "{name}" --state all --json number,title,labels --limit 1000 |
| 从议题移除标签 | gh api /repos/{owner}/{repo}/issues/{number}/labels/{label_name} -X DELETE |
询问用户他们正在迁移什么:
当用户希望将仓库标签转换为议题字段值时,使用此流程。标签只能映射到 single_select 议题字段(每个标签名称映射到一个选项值)。
向用户询问:要迁移的组织名称和仓库。
从每个仓库获取标签:
gh label list -R {owner}/{repo} --limit 1000 --json name,color,description
获取组织议题字段:
gh api /orgs/{org}/issue-fields \
-H "X-GitHub-Api-Version: 2026-03-10" \
--jq '.[] | {id, name, content_type, options: [.options[]?.name]}'
过滤(针对标签很多的仓库):如果仓库有 50 个以上的标签,按公共前缀(例如 priority-*、team-*、type-*)或颜色分组。在映射之前,让用户使用“显示匹配 priority 的标签”或“显示蓝色标签”进行过滤。切勿一次性转储 100 个以上的标签。
询问用户哪些标签映射到哪个议题字段和选项。支持以下模式:
自动建议映射:对于每个标签,尝试使用以下模式(按顺序)匹配议题字段选项:
Bug → 选项 Bug{prefix}-{n} → {P}{n}):标签 priority-1 → 选项 P1good_first_issue → 选项 Good First Issuetype: bug → 选项 Bug一次性呈现所有建议,供用户确认、更正或跳过。
示例输出:
Labels in github/my-repo (showing relevant ones):
p0, p1, p2, p3, bug, enhancement, frontend, backend
Org issue fields (single_select):
Priority: Critical, P0, P1, P2, P3
Type: Bug, Feature, Task
Team: Frontend, Backend, Design
Suggested mappings:
Label "p0" → Priority "P0"
Label "p1" → Priority "P1"
Label "p2" → Priority "P2"
Label "p3" → Priority "P3"
Label "bug" → Type "Bug"
Label "frontend" → Team "Frontend"
Label "backend" → Team "Backend"
Label "enhancement" → (no auto-match; skip or map manually)
Confirm, adjust, or add more mappings?
确定标签到选项的映射后,检查冲突。当某个议题有多个标签映射到同一个议题字段时,就会发生冲突(因为 single_select 字段只能保存一个值)。
示例:
Potential conflict: labels "p0" and "p1" both map to the Priority field.
If an issue has both labels, which value should win?
Options:
1. First match (use "p0" since it appears first in the mapping)
2. Skip conflicting issues
3. I'll decide case by case
对于每个仓库,验证写入权限并缓存 repository_id:
gh api /repos/{owner}/{repo} --jq '{full_name, id, permissions: .permissions}'
对于映射中的每个标签,获取匹配的议题:
gh issue list -R {owner}/{repo} --label "{label_name}" --state all \
--json number,title,labels,type --limit 1000
警告:--limit 1000 会静默截断结果。如果您预计某个标签可能有超过 1000 个议题,请手动分页或先验证总数(例如 gh issue list --label "X" --state all --json number | jq length)。
PR 过滤:gh issue list 返回议题和拉取请求。如果用户只想迁移议题,请在 --json 输出中包含 type 并过滤 type == "Issue"。
在任何写入操作之前呈现摘要。
示例预览:
Label Migration Preview
Source: labels in github/my-repo
Target fields: Priority, Type, Team
| Category | Count |
|-------------------------|-------|
| Issues to migrate | 156 |
| Already set (skip) | 12 |
| Conflicting labels (skip)| 3 |
| Total issues with labels| 171 |
Label breakdown:
"p1" → Priority "P1": 42 issues
"p2" → Priority "P2": 67 issues
"p3" → Priority "P3": 38 issues
"bug" → Type "Bug": 9 issues
Sample changes (first 5):
github/my-repo#101: Priority → "P1"
github/my-repo#203: Priority → "P2", Type → "Bug"
github/my-repo#44: Priority → "P3"
github/my-repo#310: Priority → "P1"
github/my-repo#7: Type → "Bug"
After migration, do you also want to remove the migrated labels from issues? (optional)
Estimated time: ~24s (156 API calls at 0.15s each)
Proceed?
对于每个要迁移的议题,写入议题字段值(与项目字段迁移相同的端点):
echo '{"issue_field_values": [{"field_id": FIELD_ID, "value": "OPTION_NAME"}]}' | \
gh api /repositories/{repo_id}/issues/{number}/issue-field-values \
-X POST \
-H "X-GitHub-Api-Version: 2026-03-10" \
--input -
将 FIELD_ID 替换为整数字段 ID(例如 1),将 OPTION_NAME 替换为选项名称字符串。
如果用户选择移除标签,在成功写入字段后移除每个已迁移的标签:
gh api /repos/{owner}/{repo}/issues/{number}/labels/{label_name} -X DELETE
对包含空格或特殊字符的标签名称进行 URL 编码。
节奏控制:调用之间延迟 100 毫秒。在 HTTP 429 响应时,使用指数退避(1 秒、2 秒、4 秒,最多 30 秒)。
进度报告:每处理 25 个项目报告一次(例如,“已迁移 75/156 个议题...”)。
错误处理:记录失败但继续处理。单独包含标签移除失败。
最终摘要:
Label Migration Complete
| Result | Count |
|-----------------------|-------|
| Fields set | 153 |
| Labels removed | 153 |
| Skipped | 15 |
| Failed (field write) | 2 |
| Failed (label remove) | 1 |
Failed items:
github/my-repo#501: 403 Forbidden (insufficient permissions)
github/my-repo#88: 422 Validation failed (field not available on repo)
github/my-repo#120: label removal failed (404, label already removed)
当用户希望将值从 GitHub 项目 V2 字段复制到相应的组织层级议题字段时,使用此流程。
按顺序遵循以下六个阶段。始终在执行前预览。
向用户询问:组织名称和项目编号(或项目 URL)。
获取项目字段:
# Use MCP tool
mcp__github__projects_list(owner: "{org}", project_number: {n}, method: "list_project_fields")
获取组织议题字段:
gh api /orgs/{org}/issue-fields \
-H "X-GitHub-Api-Version: 2026-03-10" \
--jq '.[] | {id, name, content_type, options: [.options[]?.name]}'
过滤掉代理字段:在项目上启用议题字段后,某些项目字段会显示为“代理”条目,对于单选类型其 options: [] 为空。这些字段镜像了真实的议题字段,应被忽略。仅匹配具有实际选项值的项目字段。
通过名称(不区分大小写)和兼容类型自动匹配字段:
| 项目字段类型 | 议题字段类型 | 是否兼容? |
|---|---|---|
| TEXT | text | 是,直接复制 |
| SINGLE_SELECT | single_select | 是,需要选项映射 |
| NUMBER | number | 是,直接复制 |
| DATE | date | 是,直接复制 |
| ITERATION | (无) | 无等效项;跳过并警告 |
示例输出:
Found 3 potential field mappings:
| # | Project Field | Type | Issue Field | Status |
|---|-------------------|---------------|--------------------|------------|
| 1 | Priority (renamed) | SINGLE_SELECT | Priority | Auto-match |
| 2 | Due Date | DATE | Due Date | Auto-match |
| 3 | Sprint | ITERATION | (no equivalent) | Skipped |
Proceed with fields 1 and 2? You can also add manual mappings.
对于每个匹配的单选字段对:
示例输出:
Option mapping for "Release - Target":
Auto-matched (case-insensitive):
"GA" → "GA"
"Private Preview" → "Private Preview"
"Public Preview" → "Public Preview"
Unmapped project options (need your input):
1. "Internal Only" → which issue field option? (or skip)
2. "Retired" → which issue field option? (or skip)
3. "Beta" → which issue field option? (or skip)
4. "Deprecated" → which issue field option? (or skip)
Available issue field options not yet mapped: "Internal", "Sunset", "Beta Testing", "End of Life"
Please provide mappings for all 4 options above (e.g., "1→Internal, 2→Sunset, 3→Beta Testing, 4→skip").
在扫描项目项之前,验证对可能涉及的每个仓库的写入权限:
从项目项(第一页)收集唯一的 {owner}/{repo} 值集合。
对于每个唯一的仓库,验证认证用户是否具有 Issues 写入权限:
gh api /repos/{owner}/{repo} --jq '{full_name, permissions: .permissions}'
如果任何仓库显示 push: false 或 triage: false,在继续之前警告用户。这些仓库中的项目项在写入时会失败。
现在缓存每个仓库的 repository_id(整数);在阶段 6 中会需要它:
gh api /repos/{owner}/{repo} --jq .id
使用 MCP 获取所有项目项。重要:对于超过约 200 个项目的项目,gh api graphql --paginate 不可靠(它会连接 JSON 响应而没有适当的分隔符,并且可能超时)。使用内部处理分页的 MCP 工具,或使用显式的基于游标的分页:
# Preferred: use MCP tool (handles pagination automatically)
mcp__github__projects_list(owner: "{org}", project_number: {n}, method: "list_project_items")
# Fallback for large projects: manual cursor-based pagination
# Fetch 100 items per page, advancing the cursor each time.
# Process each page before fetching the next to avoid memory issues.
# Save progress (page number or last cursor) so you can resume if interrupted.
对于每个项目项:
如果是草稿项(非真实议题)则跳过。
提取源项目字段值。
如果源值为空则跳过。
检查议题是否已为目标议题字段设置了值:
gh api /repos/{owner}/{repo}/issues/{number}/issue-field-values \
-H "X-GitHub-Api-Version: 2026-03-10"
如果议题字段已有值,则跳过它(保留现有数据)。
将每个项目项分类为以下之一:
在任何写入操作之前呈现摘要。
如果用户请求试运行:显示完整的详细报告(每个议题、其当前值、建议的新值和跳过原因)并停止。不执行。
否则(预览模式):显示摘要计数和更改示例,然后请求确认。
示例预览:
Migration Preview for Project #42
Fields to migrate: Priority, Due Date
| Category | Count |
|------------------------|-------|
| Items to migrate | 847 |
| Already set (skip) | 23 |
| No source value (skip) | 130 |
| Draft items (skip) | 12 |
| Total project items | 1,012 |
Sample changes (first 5):
github/repo-a#101: Priority → "High"
github/repo-a#203: Priority → "Medium", Due Date → "2025-03-15"
github/repo-b#44: Priority → "Low"
github/repo-a#310: Due Date → "2025-04-01"
github/repo-c#7: Priority → "Critical"
Estimated time: ~127s (847 API calls at 0.15s each)
Proceed with migration? This will update 847 issues across 3 repositories.
使用阶段 3 中缓存的 repository_id 值。
对于每个要迁移的项目项,写入议题字段值:
echo '{"issue_field_values": [{"field_id": FIELD_ID, "value": "VALUE"}]}' | \
gh api /repositories/{repo_id}/issues/{number}/issue-field-values \
-X POST \
-H "X-GitHub-Api-Version: 2026-03-10" \
--input -
将 FIELD_ID 替换为整数字段 ID(例如 1),将 VALUE 替换为值字符串。
节奏控制:在 API 调用之间添加 100 毫秒的延迟。在 HTTP 429 响应时,使用指数退避(1 秒、2 秒、4 秒,最多 30 秒)。
进度报告:每处理 25 个项目报告一次状态(例如,“已迁移 75/847 个项目...”)。
错误处理:记录失败但继续处理剩余项目。
最终摘要:
Migration Complete
| Result | Count |
|---------|-------|
| Success | 842 |
| Skipped | 165 |
| Failed | 5 |
Failed items:
github/repo-a#501: 403 Forbidden (insufficient permissions)
github/repo-b#88: 422 Validation failed (field not available on repo)
...
repository_id(整数),而不是 owner/repo。始终先用 gh api /repos/{owner}/{repo} --jq .id 查找仓库 ID。.single_select_option.name 获取人类可读的值。.value 属性返回内部选项 ID(一个整数,如 1201),而不是显示名称。X-GitHub-Api-Version: 2026-03-10。good%20first%20issue)。--limit 1000 截断:gh issue list --limit 1000 会在 1000 个结果处静默停止。对于有更多议题的标签,使用 --jq 和基于游标的分页进行分页,或运行多个过滤查询(例如按日期范围)。declare -A(关联数组)。生成的脚本应使用 POSIX 兼容的结构,或注明不兼容性并建议 brew install bash。gh issue list 返回议题和拉取请求。如果迁移应仅针对议题,请在 --json 输出中包含 type 并过滤 type == "Issue"。用户:“我需要将优先级值从我们的项目迁移到新的组织优先级议题字段”
操作:遵循阶段 P1-P6。发现字段、映射选项、检查权限、扫描项目项、预览、执行。
用户:“向我展示如果我将字段从项目 #42 迁移会发生什么,但不要实际执行”
操作:仅遵循阶段 P1-P5。呈现列出每个项目项的完整试运行报告。不执行。
用户:“将优先级和截止日期从项目 #15 迁移到议题字段”
操作:相同的工作流程,但在单次扫描中处理两个字段。在数据扫描期间,收集每个项目项的所有映射字段的值。每个议题通过一次 API 调用写入所有字段值。
用户:“我想将 'bug' 标签迁移到 Type 议题字段”
操作:路由到标签迁移流程。询问组织/仓库,列出标签,确认映射:标签 "bug" → Type 字段 "Bug" 选项。扫描带有该标签的议题,预览,执行。询问迁移后是否移除标签。
用户:“我们有 p0, p1, p2, p3 标签,希望将它们转换为 Priority 议题字段”
操作:路由到标签迁移流程。将所有四个标签映射到 Priority 字段选项(p0→P0, p1→P1, p2→P2, p3→P3)。检查冲突(有多个优先级标签的议题)。在一个摘要中预览所有更改。单次执行。可选择从已迁移的议题中移除所有四个标签。
用户:“将 'frontend' 和 'backend' 标签迁移到 Team 议题字段,跨越 github/issues、github/memex 和 github/mobile,然后移除旧标签”
操作:路由到标签迁移流程。确认仓库和标签映射:"frontend"→Team "Frontend"、"backend"→Team "Backend"。扫描所有三个仓库中带有这些标签的议题。检测冲突(同时带有两个标签的议题)。跨仓库预览。执行字段写入,然后从已迁移的议题中移除标签。按仓库报告统计信息。
每周安装次数
478
仓库
GitHub 星标数
26.9K
首次出现
12 天前
安全审计
安装于
gemini-cli436
codex434
opencode425
cursor422
github-copilot419
kimi-cli418
Issue fields are org-level typed metadata (single select, text, number, date) that replace label-based workarounds with structured, searchable, cross-repo fields. Every organization gets Priority, Effort, Start date, and Target date preconfigured, with support for up to 25 custom fields.
This skill bulk-migrates existing metadata into issue fields from two sources:
p0, p1, priority/high into structured issue field values (e.g. the Priority field). Supports migrating multiple labels at once and optionally removing them after migration.gh CLI must be authenticated with appropriate scopes| Tool | Purpose |
|---|---|
mcp__github__projects_list | List project fields (list_project_fields), list project items with values (list_project_items) |
mcp__github__projects_get | Get details of a specific project field or item |
| Operation | Command |
|---|---|
| List org issue fields | gh api /orgs/{org}/issue-fields -H "X-GitHub-Api-Version: 2026-03-10" |
| Read issue field values | gh api /repos/{owner}/{repo}/issues/{number}/issue-field-values -H "X-GitHub-Api-Version: 2026-03-10" |
| Write issue field values | gh api /repositories/{repo_id}/issues/{number}/issue-field-values -X POST -H "X-GitHub-Api-Version: 2026-03-10" --input - |
| Get repository ID | gh api /repos/{owner}/{repo} --jq .id |
| List repo labels | gh label list -R {owner}/{repo} --limit 1000 --json name,color,description |
See references/issue-fields-api.md, references/projects-api.md, and references/labels-api.md for full API details.
Ask the user what they are migrating:
"Are you migrating labels or project fields?"
If the user says labels :
If the user says project fields :
Use this flow when the user wants to convert repo labels into issue field values. Labels can only map to single_select issue fields (each label name maps to one option value).
gh label list -R {owner}/{repo} --limit 1000 --json name,color,description
gh api /orgs/{org}/issue-fields \
-H "X-GitHub-Api-Version: 2026-03-10" \
--jq '.[] | {id, name, content_type, options: [.options[]?.name]}'
4. Filtering (for repos with many labels): if the repo has 50+ labels, group by common prefix (e.g., priority-*, team-*, type-*) or color. Let the user filter with "show labels matching priority" or "show blue labels" before mapping. Never dump 100+ labels at once.
Ask the user which labels map to which issue field and option. Support these patterns:
Auto-suggest mappings : for each label, attempt to match issue field options using these patterns (in order):
Bug → option Bug{prefix}-{n} → {P}{n}): label priority-1 → option P1Present all suggestions at once for the user to confirm, correct, or skip.
Example output:
Labels in github/my-repo (showing relevant ones):
p0, p1, p2, p3, bug, enhancement, frontend, backend
Org issue fields (single_select):
Priority: Critical, P0, P1, P2, P3
Type: Bug, Feature, Task
Team: Frontend, Backend, Design
Suggested mappings:
Label "p0" → Priority "P0"
Label "p1" → Priority "P1"
Label "p2" → Priority "P2"
Label "p3" → Priority "P3"
Label "bug" → Type "Bug"
Label "frontend" → Team "Frontend"
Label "backend" → Team "Backend"
Label "enhancement" → (no auto-match; skip or map manually)
Confirm, adjust, or add more mappings?
After finalizing the label-to-option mappings, check for conflicts. A conflict occurs when an issue has multiple labels that map to the same issue field (since single_select fields can hold only one value).
Example:
Potential conflict: labels "p0" and "p1" both map to the Priority field.
If an issue has both labels, which value should win?
Options:
1. First match (use "p0" since it appears first in the mapping)
2. Skip conflicting issues
3. I'll decide case by case
repository_id:gh api /repos/{owner}/{repo} --jq '{full_name, id, permissions: .permissions}'
gh issue list -R {owner}/{repo} --label "{label_name}" --state all \
--json number,title,labels,type --limit 1000
Warning : --limit 1000 silently truncates results. If you expect a label may have more than 1000 issues, paginate manually or verify the total count first (e.g., gh issue list --label "X" --state all --json number | jq length).
PR filtering : gh issue list returns both issues and PRs. Include type in the --json output and filter for type == "Issue" if the user only wants issues migrated.
If all selected labels return 0 issues , stop and tell the user. Suggest: try different labels, check spelling, or try a different repository. Do not proceed with an empty migration.
For multi-repo migrations, repeat across all specified repos.
For each issue found:
Present a summary before any writes.
Example preview:
Label Migration Preview
Source: labels in github/my-repo
Target fields: Priority, Type, Team
| Category | Count |
|-------------------------|-------|
| Issues to migrate | 156 |
| Already set (skip) | 12 |
| Conflicting labels (skip)| 3 |
| Total issues with labels| 171 |
Label breakdown:
"p1" → Priority "P1": 42 issues
"p2" → Priority "P2": 67 issues
"p3" → Priority "P3": 38 issues
"bug" → Type "Bug": 9 issues
Sample changes (first 5):
github/my-repo#101: Priority → "P1"
github/my-repo#203: Priority → "P2", Type → "Bug"
github/my-repo#44: Priority → "P3"
github/my-repo#310: Priority → "P1"
github/my-repo#7: Type → "Bug"
After migration, do you also want to remove the migrated labels from issues? (optional)
Estimated time: ~24s (156 API calls at 0.15s each)
Proceed?
echo '{"issue_field_values": [{"field_id": FIELD_ID, "value": "OPTION_NAME"}]}' | \
gh api /repositories/{repo_id}/issues/{number}/issue-field-values \
-X POST \
-H "X-GitHub-Api-Version: 2026-03-10" \
--input -
Replace FIELD_ID with the integer field ID (e.g., 1) and OPTION_NAME with the option name string.
gh api /repos/{owner}/{repo}/issues/{number}/labels/{label_name} -X DELETE
URL-encode label names that contain spaces or special characters.
Label Migration Complete
| Result | Count |
|-----------------------|-------|
| Fields set | 153 |
| Labels removed | 153 |
| Skipped | 15 |
| Failed (field write) | 2 |
| Failed (label remove) | 1 |
Failed items:
github/my-repo#501: 403 Forbidden (insufficient permissions)
github/my-repo#88: 422 Validation failed (field not available on repo)
github/my-repo#120: label removal failed (404, label already removed)
Use this flow when the user wants to copy values from a GitHub Project V2 field to the corresponding org-level issue field.
Follow these six phases in order. Always preview before executing.
# Use MCP tool
mcp__github__projects_list(owner: "{org}", project_number: {n}, method: "list_project_fields")
3. Fetch org issue fields:
gh api /orgs/{org}/issue-fields \
-H "X-GitHub-Api-Version: 2026-03-10" \
--jq '.[] | {id, name, content_type, options: [.options[]?.name]}'
4. Filter out proxy fields : after issue fields are enabled on a project, some project fields appear as "proxy" entries with empty options: [] for single-select types. These mirror the real issue fields and should be ignored. Only match against project fields that have actual option values.
| Project Field Type | Issue Field Type | Compatible? |
|---|---|---|
| TEXT | text | Yes, direct copy |
| SINGLE_SELECT | single_select | Yes, option mapping needed |
| NUMBER | number | Yes, direct copy |
| DATE | date | Yes, direct copy |
| ITERATION | (none) | No equivalent; skip with warning |
Example output:
Found 3 potential field mappings:
| # | Project Field | Type | Issue Field | Status |
|---|-------------------|---------------|--------------------|------------|
| 1 | Priority (renamed) | SINGLE_SELECT | Priority | Auto-match |
| 2 | Due Date | DATE | Due Date | Auto-match |
| 3 | Sprint | ITERATION | (no equivalent) | Skipped |
Proceed with fields 1 and 2? You can also add manual mappings.
For each matched single-select pair:
Example output:
Option mapping for "Release - Target":
Auto-matched (case-insensitive):
"GA" → "GA"
"Private Preview" → "Private Preview"
"Public Preview" → "Public Preview"
Unmapped project options (need your input):
1. "Internal Only" → which issue field option? (or skip)
2. "Retired" → which issue field option? (or skip)
3. "Beta" → which issue field option? (or skip)
4. "Deprecated" → which issue field option? (or skip)
Available issue field options not yet mapped: "Internal", "Sunset", "Beta Testing", "End of Life"
Please provide mappings for all 4 options above (e.g., "1→Internal, 2→Sunset, 3→Beta Testing, 4→skip").
Before scanning items, verify write access to each repository that may be touched:
{owner}/{repo} values.gh api /repos/{owner}/{repo} --jq '{full_name, permissions: .permissions}'
push: false or triage: false, warn the user before proceeding. Items in those repos will fail at write time.repository_id (integer) for each repo now; you will need it in Phase 6:gh api /repos/{owner}/{repo} --jq .id
gh api graphql --paginate is unreliable (it concatenates JSON responses without proper separators and can time out). Use the MCP tool which handles pagination internally, or use explicit cursor-based pagination:# Preferred: use MCP tool (handles pagination automatically)
mcp__github__projects_list(owner: "{org}", project_number: {n}, method: "list_project_items")
# Fallback for large projects: manual cursor-based pagination
# Fetch 100 items per page, advancing the cursor each time.
# Process each page before fetching the next to avoid memory issues.
# Save progress (page number or last cursor) so you can resume if interrupted.
2. For each item: * Skip if it is a draft item (not a real issue). * Extract the source project field value. * Skip if the source value is empty. * Check if the issue already has a value for the target issue field:
gh api /repos/{owner}/{repo}/issues/{number}/issue-field-values \
-H "X-GitHub-Api-Version: 2026-03-10"
Present a summary before any writes.
If user requested dry-run : show the full detailed report (every issue, its current value, proposed new value, and skip reason) and stop. Do not execute.
Otherwise (preview mode) : show summary counts and a sample of changes, then ask for confirmation.
Example preview:
Migration Preview for Project #42
Fields to migrate: Priority, Due Date
| Category | Count |
|------------------------|-------|
| Items to migrate | 847 |
| Already set (skip) | 23 |
| No source value (skip) | 130 |
| Draft items (skip) | 12 |
| Total project items | 1,012 |
Sample changes (first 5):
github/repo-a#101: Priority → "High"
github/repo-a#203: Priority → "Medium", Due Date → "2025-03-15"
github/repo-b#44: Priority → "Low"
github/repo-a#310: Due Date → "2025-04-01"
github/repo-c#7: Priority → "Critical"
Estimated time: ~127s (847 API calls at 0.15s each)
Proceed with migration? This will update 847 issues across 3 repositories.
Use the repository_id values cached in Phase 3.
For each item to migrate, write the issue field value:
echo '{"issue_field_values": [{"field_id": FIELD_ID, "value": "VALUE"}]}' | \
gh api /repositories/{repo_id}/issues/{number}/issue-field-values \
-X POST \
-H "X-GitHub-Api-Version: 2026-03-10" \
--input -
Replace FIELD_ID with the integer field ID (e.g., 1) and VALUE with the value string.
Migration Complete
| Result | Count |
|---------|-------|
| Success | 842 |
| Skipped | 165 |
| Failed | 5 |
Failed items:
github/repo-a#501: 403 Forbidden (insufficient permissions)
github/repo-b#88: 422 Validation failed (field not available on repo)
...
repository_id (integer), not owner/repo. Always look up the repo ID first with gh api /repos/{owner}/{repo} --jq .id..single_select_option.name for the human-readable value. The .value property returns the internal option ID (an integer like 1201), not the display name.X-GitHub-Api-Version: 2026-03-10.User : "I need to migrate Priority values from our project to the new org Priority issue field"
Action : Follow Phases P1-P6. Discover fields, map options, check permissions, scan items, preview, execute.
User : "Show me what would happen if I migrated fields from project #42, but don't actually do it"
Action : Follow Phases P1-P5 only. Present the full dry-run report with every item listed. Do not execute.
User : "Migrate Priority and Due Date from project #15 to issue fields"
Action : Same workflow, but process both fields in a single pass. During the data scan, collect values for all mapped fields per item. Write all field values in a single API call per issue.
User : "I want to migrate the 'bug' label to the Type issue field"
Action : Route to Label Migration Flow. Ask for org/repo, list labels, confirm mapping: label "bug" → Type field "Bug" option. Scan issues with that label, preview, execute. Ask whether to remove the label after migration.
User : "We have p0, p1, p2, p3 labels and want to convert them to the Priority issue field"
Action : Route to Label Migration Flow. Map all four labels to Priority field options (p0→P0, p1→P1, p2→P2, p3→P3). Check for conflicts (issues with multiple priority labels). Preview all changes in one summary. Execute in one pass. Optionally remove all four labels from migrated issues.
User : "Migrate the 'frontend' and 'backend' labels to the Team issue field across github/issues, github/memex, and github/mobile, then remove the old labels"
Action : Route to Label Migration Flow. Confirm repos and label mappings: "frontend"→Team "Frontend", "backend"→Team "Backend". Scan all three repos for issues with these labels. Detect conflicts (issues with both labels). Preview across repos. Execute field writes, then remove labels from migrated issues. Report per-repo stats.
Weekly Installs
478
Repository
GitHub Stars
26.9K
First Seen
12 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli436
codex434
opencode425
cursor422
github-copilot419
kimi-cli418
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
138,300 周安装
wacli - WhatsApp 命令行工具:安全发送消息、搜索历史记录与同步管理
372 周安装
React Native Reanimated + Skia 动画性能优化指南:提升帧率与流畅度
373 周安装
React前端开发指南:Suspense数据获取、懒加载与性能优化最佳实践
373 周安装
Lark Mail CLI 使用指南:邮件管理、安全规则与自动化工作流
7,100 周安装
OpenAPI 转 TypeScript 工具 - 自动生成 API 接口与类型守卫
563 周安装
Rust Unsafe代码检查器 - 安全使用Unsafe Rust的完整指南与最佳实践
566 周安装
| List issues by label | gh issue list -R {owner}/{repo} --label "{name}" --state all --json number,title,labels --limit 1000 |
| Remove label from issue | gh api /repos/{owner}/{repo}/issues/{number}/labels/{label_name} -X DELETE |
good_first_issueGood First Issuetype: bug → option Buggood%20first%20issue).--limit 1000 truncation: gh issue list --limit 1000 silently stops at 1000 results. For labels with more issues, paginate with --jq and cursor-based pagination or run multiple filtered queries (e.g., by date range).declare -A (associative arrays). Generated scripts should use POSIX-compatible constructs or note the incompatibility and suggest brew install bash.gh issue list returns both issues and pull requests. If the migration should only target issues, include type in --json output and filter for type == "Issue".