gitlab-issue

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Issue Skill

Issue 操作技能

Issue operations for GitLab using the
glab
CLI.
使用
glab
CLI进行GitLab Issue操作。

Quick Reference

快速参考

OperationCommandRisk
List issues
glab issue list
-
View issue
glab issue view <id>
-
Create issue
glab issue create
⚠️
Update issue
glab issue update <id>
⚠️
Close issue
glab issue close <id>
⚠️
Reopen issue
glab issue reopen <id>
⚠️
Delete issue
glab issue delete <id>
⚠️⚠️
Add note
glab issue note <id>
⚠️
Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger
操作命令风险等级
列出Issue
glab issue list
-
查看Issue
glab issue view <id>
-
创建Issue
glab issue create
⚠️
更新Issue
glab issue update <id>
⚠️
关闭Issue
glab issue close <id>
⚠️
重新打开Issue
glab issue reopen <id>
⚠️
删除Issue
glab issue delete <id>
⚠️⚠️
添加备注
glab issue note <id>
⚠️
风险等级说明:- 安全 | ⚠️ 注意 | ⚠️⚠️ 警告 | ⚠️⚠️⚠️ 危险

When to Use This Skill

何时使用本技能

ALWAYS use when:
  • User wants to work with issues
  • User mentions "issue", "bug", "task", "ticket" or related terms
  • User wants to track or manage work items
NEVER use when:
  • User wants bulk operations on 10+ issues (use gitlab-bulk instead)
  • User is only searching/filtering issues (use gitlab-search instead)
请务必使用本技能的场景:
  • 用户需要处理Issue
  • 用户提及“Issue”、“Bug”、“任务”、“工单”或相关术语
  • 用户需要跟踪或管理工作项
请勿使用本技能的场景:
  • 用户需要对10个以上的Issue进行批量操作(请使用gitlab-bulk技能)
  • 用户仅需搜索/筛选Issue(请使用gitlab-search技能)

Available Commands

可用命令

List Issues

列出Issue

bash
glab issue list [options]
Options:
FlagDescription
-a, --assignee=<user>
Filter by assignee (use @me for yourself)
--author=<user>
Filter by author
-l, --label=<labels>
Filter by comma-separated labels
-m, --milestone=<milestone>
Filter by milestone
-s, --state=<state>
Filter by state: opened, closed, all (default: opened)
-c, --closed
Get only closed issues
--all
Get all issues
-P, --per-page=<n>
Number of items per page
--confidential
Filter to only confidential issues
--search=<query>
Search issues by title/description
Examples:
bash
undefined
bash
glab issue list [options]
选项:
标识说明
-a, --assignee=<user>
按经办人筛选(使用@me指代自己)
--author=<user>
按创建人筛选
-l, --label=<labels>
按逗号分隔的标签筛选
-m, --milestone=<milestone>
按里程碑筛选
-s, --state=<state>
按状态筛选:opened(已打开)、closed(已关闭)、all(全部)(默认:opened)
-c, --closed
仅查看已关闭的Issue
--all
查看所有Issue
-P, --per-page=<n>
每页显示的条目数
--confidential
仅查看保密Issue
--search=<query>
按标题/描述搜索Issue
示例:
bash
undefined

List all open issues

列出所有已打开的Issue

glab issue list
glab issue list

List issues assigned to you

列出分配给自己的Issue

glab issue list --assignee=@me
glab issue list --assignee=@me

List closed issues

列出已关闭的Issue

glab issue list --closed
glab issue list --closed

List issues with specific label

列出带有特定标签的Issue

glab issue list --label=bug
glab issue list --label=bug

List issues in a milestone

列出指定里程碑中的Issue

glab issue list --milestone="Release 1.0"
glab issue list --milestone="Release 1.0"

Search issues

搜索Issue

glab issue list --search="login bug"
glab issue list --search="login bug"

Get all issues (paginated)

查看所有Issue(分页)

glab issue list --all
undefined
glab issue list --all
undefined

View Issue Details

查看Issue详情

bash
glab issue view <id> [options]
Options:
FlagDescription
-w, --web
Open issue in browser
-c, --comments
Show issue comments
-s, --system-logs
Show system activities
Examples:
bash
undefined
bash
glab issue view <id> [options]
选项:
标识说明
-w, --web
在浏览器中打开Issue
-c, --comments
显示Issue评论
-s, --system-logs
显示系统活动日志
示例:
bash
undefined

View issue in terminal

在终端中查看Issue详情

glab issue view 42
glab issue view 42

Open issue in browser

在浏览器中打开Issue

glab issue view 42 --web
glab issue view 42 --web

View with comments

查看Issue及评论

glab issue view 42 --comments
undefined
glab issue view 42 --comments
undefined

Create Issue

创建Issue

bash
glab issue create [options]
Options:
FlagDescription
-t, --title=<title>
Issue title
-d, --description=<desc>
Issue description
-a, --assignee=<users>
Comma-separated assignees
-l, --label=<labels>
Comma-separated labels
-m, --milestone=<milestone>
Milestone title
--confidential
Create as confidential
--weight=<n>
Issue weight (0-9)
-w, --web
Open in browser after creation
-y, --yes
Skip confirmation prompts
Examples:
bash
undefined
bash
glab issue create [options]
选项:
标识说明
-t, --title=<title>
Issue标题
-d, --description=<desc>
Issue描述
-a, --assignee=<users>
逗号分隔的经办人列表
-l, --label=<labels>
逗号分隔的标签列表
-m, --milestone=<milestone>
里程碑标题
--confidential
创建为保密Issue
--weight=<n>
Issue权重(0-9)
-w, --web
创建后在浏览器中打开
-y, --yes
跳过确认提示
示例:
bash
undefined

Create issue with title

创建带标题的Issue

glab issue create -t "Fix login bug"
glab issue create -t "Fix login bug"

Create issue with full details

创建包含完整信息的Issue

glab issue create -t "Add dark mode" -d "Implement dark mode toggle" -l "enhancement,ui"
glab issue create -t "Add dark mode" -d "Implement dark mode toggle" -l "enhancement,ui"

Create issue with milestone and assignee

创建指定里程碑和经办人的Issue

glab issue create -t "Release prep" -m "Release 2.0" -a "@me"
glab issue create -t "Release prep" -m "Release 2.0" -a "@me"

Create confidential issue

创建保密Issue

glab issue create -t "Security vulnerability" --confidential
glab issue create -t "Security vulnerability" --confidential

Create and open in browser

创建并在浏览器中打开

glab issue create -t "New feature" --web
undefined
glab issue create -t "New feature" --web
undefined

Update Issue

更新Issue

bash
glab issue update <id> [options]
Options:
FlagDescription
-t, --title=<title>
Update title
-d, --description=<desc>
Update description
-a, --assignee=<users>
Update assignees
--unassign
Remove all assignees
-l, --label=<labels>
Add labels
--unlabel=<labels>
Remove labels
-m, --milestone=<milestone>
Set milestone
--confidential
Mark as confidential
--public
Mark as public
--lock-discussion
Lock discussion
--unlock-discussion
Unlock discussion
Examples:
bash
undefined
bash
glab issue update <id> [options]
选项:
标识说明
-t, --title=<title>
更新标题
-d, --description=<desc>
更新描述
-a, --assignee=<users>
更新经办人
--unassign
移除所有经办人
-l, --label=<labels>
添加标签
--unlabel=<labels>
移除标签
-m, --milestone=<milestone>
设置里程碑
--confidential
标记为保密Issue
--public
标记为公开Issue
--lock-discussion
锁定讨论
--unlock-discussion
解锁讨论
示例:
bash
undefined

Update title

更新标题

glab issue update 42 -t "Updated title"
glab issue update 42 -t "Updated title"

Add labels

添加标签

glab issue update 42 -l "priority,reviewed"
glab issue update 42 -l "priority,reviewed"

Remove labels

移除标签

glab issue update 42 --unlabel="needs-review"
glab issue update 42 --unlabel="needs-review"

Change assignee

更换经办人

glab issue update 42 -a "username"
glab issue update 42 -a "username"

Add to milestone

添加到指定里程碑

glab issue update 42 -m "Sprint 5"
undefined
glab issue update 42 -m "Sprint 5"
undefined

Close/Reopen Issue

关闭/重新打开Issue

bash
undefined
bash
undefined

Close issue

关闭Issue

glab issue close <id>
glab issue close <id>

Reopen issue

重新打开Issue

glab issue reopen <id>
undefined
glab issue reopen <id>
undefined

Delete Issue

删除Issue

bash
glab issue delete <id>
Warning: This permanently deletes the issue. Use with caution.
bash
glab issue delete <id>
警告:此操作会永久删除Issue,请谨慎使用。

Add Note/Comment

添加备注/评论

bash
glab issue note <id> -m "<message>"
Examples:
bash
undefined
bash
glab issue note <id> -m "<message>"
示例:
bash
undefined

Add comment

添加评论

glab issue note 42 -m "Working on this now"
glab issue note 42 -m "Working on this now"

Add closing comment

添加关闭评论

glab issue note 42 -m "Fixed in !123"
undefined
glab issue note 42 -m "Fixed in !123"
undefined

Subscribe/Unsubscribe

订阅/取消订阅

bash
undefined
bash
undefined

Subscribe to issue notifications

订阅Issue通知

glab issue subscribe <id>
glab issue subscribe <id>

Unsubscribe

取消订阅

glab issue unsubscribe <id>
undefined
glab issue unsubscribe <id>
undefined

Common Workflows

常见工作流

Workflow 1: Triage Issues

工作流1:Issue分类处理

bash
undefined
bash
undefined

1. List unassigned issues

1. 列出未分配的Issue

glab issue list --assignee=""
glab issue list --assignee=""

2. View issue details

2. 查看Issue详情

glab issue view 42
glab issue view 42

3. Assign and label

3. 分配经办人并添加标签

glab issue update 42 -a "developer" -l "bug,priority"
undefined
glab issue update 42 -a "developer" -l "bug,priority"
undefined

Workflow 2: Work on Issue

工作流2:处理Issue

bash
undefined
bash
undefined

1. Find assigned issues

1. 查找分配给自己的Issue

glab issue list --assignee=@me
glab issue list --assignee=@me

2. View details

2. 查看详情

glab issue view 42
glab issue view 42

3. Create branch and work

3. 创建分支并开始工作

git checkout -b fix/issue-42
git checkout -b fix/issue-42

4. Add progress note

4. 添加进度备注

glab issue note 42 -m "Started work on this"
glab issue note 42 -m "Started work on this"

5. Close when MR is merged

5. 合并MR后关闭Issue

glab issue close 42
undefined
glab issue close 42
undefined

Workflow 3: Quick Bug Report

工作流3:快速提交Bug报告

bash
undefined
bash
undefined

Create issue with all details

创建包含完整信息的Issue

glab issue create
-t "Login fails with special characters"
-d "Steps to reproduce:
  1. Enter username with @ symbol
  2. Click login
  3. Error: 500
Expected: Login succeeds"
-l "bug,login"
undefined
glab issue create
-t "Login fails with special characters"
-d "Steps to reproduce:
  1. Enter username with @ symbol
  2. Click login
  3. Error: 500
Expected: Login succeeds"
-l "bug,login"
undefined

Troubleshooting

故障排查

IssueCauseSolution
Authentication failedInvalid/expired tokenRun
glab auth login
Issue not foundInvalid ID or no accessVerify ID with
glab issue list
Permission deniedInsufficient rightsCheck project permissions
Cannot closeIssue is lockedRequest unlock from maintainer
问题现象原因解决方法
认证失败令牌无效/过期执行
glab auth login
重新登录
未找到IssueID无效或无访问权限使用
glab issue list
验证ID
权限不足权限不够检查项目权限设置
无法关闭IssueIssue已被锁定联系维护者解锁

Related Documentation

相关文档

  • Safeguards
  • Quick Reference
  • 安全防护措施
  • 快速参考手册