# Jira 快速参考

*工单、JQL、工作流、看板、Sprint、过滤器*

> Source: Jira Documentation (support.atlassian.com) · MIT

## 工单（Issues）

### 工单类型

| Command | Description |
|---------|-------------|
| `Epic` | 大型工作体；包含多个 Story |
| `Story` | 面向用户的功能或需求 |
| `Task` | 工作单元（技术性或非技术性） |
| `Bug` | 缺陷或异常行为 |
| `Sub-task` | Story/Task 的子任务；不能单独存在 |

### 工单字段

| Command | Description |
|---------|-------------|
| `Summary` | 简短标题（必填） |
| `Description` | 详细说明、验收标准 |
| `Assignee` | 负责人 |
| `Priority` | 最高 / 高 / 中 / 低 / 最低 |
| `Labels` | 自由格式标签，用于分组 |
| `Components` | 项目子模块（如 Backend、UI） |
| `Fix Version` | 此工单对应的发布版本 |
| `Story Points` | 工作量估算（Scrum） |

### 工单关联

| Command | Description |
|---------|-------------|
| `blocks / is blocked by` | 依赖关系 |
| `clones / is cloned by` | 重复工单追踪 |
| `relates to` | 一般性关联 |
| `is caused by / causes` | 根因关联 |

## JQL 搜索

### 基本语法

```
project = MYPROJ AND status = "In Progress"
assignee = currentUser() AND resolution = Unresolved
priority in (High, Highest) ORDER BY created DESC
```

### 运算符

| Command | Description |
|---------|-------------|
| `=` | 精确匹配 |
| `!=` | 不等于 |
| `in (a, b)` | 匹配列表中任意值 |
| `not in (a, b)` | 排除列表 |
| `~ "text"` | 包含（文本搜索） |
| `!~ "text"` | 不包含 |
| `is EMPTY` | 字段无值 |
| `is not EMPTY` | 字段有值 |
| `> < >= <=` | 比较（日期、数值） |

### 日期函数

```
created >= -7d                       # last 7 days
due <= endOfWeek()                   # due this week
updated >= startOfMonth()            # updated this month
created >= "2025-01-01"              # since specific date
```

### 常用 JQL 模式

```
# Stale issues
status != Done AND updated <= -30d
# My open bugs
assignee = currentUser() AND type = Bug AND resolution = Unresolved
# Sprint scope
sprint in openSprints() AND project = MYPROJ
```

## 工作流

### 默认工作流

| Command | Description |
|---------|-------------|
| `To Do` | 尚未开始 |
| `In Progress` | 进行中 |
| `Done` | 已完成 |

### 扩展工作流

| Command | Description |
|---------|-------------|
| `Open` | 已创建，等待分诊 |
| `In Progress` | 积极处理中 |
| `In Review` | 代码评审或 QA |
| `Done` | 已验收并关闭 |
| `Reopened` | 从 Done 状态重新打开 |

### 工作流概念

| Command | Description |
|---------|-------------|
| `Status` | 工单的当前状态 |
| `Transition` | 状态之间的允许转换 |
| `Condition` | 谁可以执行转换 |
| `Validator` | 转换执行前的校验 |
| `Post Function` | 转换后的自动动作（如指派） |
| `Resolution` | 工单关闭原因（已修复、不修复等） |

## 看板

### 看板类型

| Command | Description |
|---------|-------------|
| `Scrum Board` | 基于 Sprint；含 backlog、Sprint 计划、velocity |
| `Kanban Board` | 持续流；WIP 限制，无 Sprint |

### 看板列

| Command | Description |
|---------|-------------|
| `Column` | 对应一个或多个状态 |
| `WIP Limit` | 列中最大工单数（Kanban） |
| `Swimlane` | 水平分组（按 Epic、负责人等） |
| `Quick Filter` | 基于 JQL 的看板切换过滤器 |

### 看板配置

| Command | Description |
|---------|-------------|
| `Filter` | 定义看板范围的 JQL 查询 |
| `Estimation` | Story Points 或原始估算 |
| `Card Layout` | 工单卡片上显示的字段 |
| `Card Colors` | 按优先级、负责人或查询着色 |

## Sprint

### Sprint 生命周期

| Command | Description |
|---------|-------------|
| `Create` | 命名 + 可选目标和日期 |
| `Plan` | 从 backlog 拖拽工单到 Sprint |
| `Start` | 设置持续时间（通常 1-4 周） |
| `Active` | 团队处理 Sprint 工单 |
| `Complete` | 未完成的工单移到 backlog 或下一 Sprint |

### Sprint 报表

| Command | Description |
|---------|-------------|
| `Burndown Chart` | 剩余工作量与时间的关系 |
| `Sprint Report` | 已完成与未完成的对比 |
| `Velocity Chart` | 每个 Sprint 的 Story Points 趋势 |
| `Cumulative Flow` | 状态分布随时间的变化 |

### Sprint JQL

```
sprint in openSprints()              # current sprint
sprint in futureSprints()            # upcoming sprints
sprint = "Sprint 12"                 # specific sprint
sprint in closedSprints() AND resolution = Unresolved
```

## 过滤器

### 创建过滤器

| Command | Description |
|---------|-------------|
| `Search` | 在工单搜索中编写 JQL |
| `Save As` | 将 JQL 另存为命名过滤器 |
| `Star` | 收藏过滤器以便快速访问 |
| `Subscription` | 按计划将过滤结果发送到邮箱 |

### 共享与权限

| Command | Description |
|---------|-------------|
| `Private` | 仅自己可见 |
| `Group` | 与指定群组共享 |
| `Project` | 与项目成员共享 |
| `Public` | 所有登录用户均可见 |
| `Edit Permissions` | 控制谁可以修改过滤器 |

### 仪表板

| Command | Description |
|---------|-------------|
| `Filter Results` | 显示过滤器工单的小部件 |
| `Pie Chart` | 按字段分类（优先级、负责人） |
| `Two Dimensional` | X/Y 矩阵（如优先级 vs 状态） |
| `Activity Stream` | 项目近期活动 |

## 快捷键

### 全局导航

| Command | Description |
|---------|-------------|
| `g then d` | 跳转到仪表板 |
| `g then b` | 跳转到看板 |
| `g then i` | 跳转到工单搜索 |
| `/` | 快速搜索 |
| `c` | 创建工单 |
| `?` | 显示键盘快捷键 |

### 工单视图

| Command | Description |
|---------|-------------|
| `a` | 指派给自己 |
| `m` | 评论 |
| `l` | 编辑标签 |
| `e` | 编辑工单 |
| `j / k` | 列表中下一个 / 上一个工单 |
| `o` | 打开选中的工单 |

### 看板快捷键

| Command | Description |
|---------|-------------|
| `1-9` | 将工单移到第 1-9 列 |
| `t` | 切换详情视图 |
| `n` | 下一张卡片 |
| `p` | 上一张卡片 |

## 常见模式

### Bug 报告模板

| Command | Description |
|---------|-------------|
| `Summary` | [组件] Bug 的简短描述 |
| `Steps to Reproduce` | 触发问题的操作步骤（编号） |
| `Expected` | 预期行为 |
| `Actual` | 实际行为 |
| `Environment` | 操作系统、浏览器、版本等 |
| `Severity` | 阻塞 / 严重 / 重大 / 次要 / 微小 |

### Story 格式

```
As a [role],
I want [action],
so that [benefit].
---
Acceptance Criteria:
- [ ] Criterion 1
- [ ] Criterion 2
```

### 批量操作

| Command | Description |
|---------|-------------|
| `Search → Select All` | 从搜索结果中选择工单 |
| `Bulk Change` | 批量编辑、转换状态或删除 |
| `CSV Export` | 导出搜索结果用于报表 |
| `Board drag` | 在列/Sprint 之间拖拽工单 |
