Sub topic 11
Planning and Tracking with GitHub Projects
This chapter assumes you can create issues, apply labels and milestones, and search issues with qualifiers. It also assumes you have broken work into task lists. Here you will see how GitHub Projects turns those issues into a board you can plan against.
What a project is
A GitHub project is a planning view built on top of issues and pull requests. It does not copy them. Each item in a project points to the original issue, so a change to the title, labels, or state shows up in both places.
A project belongs to a user or an organization, not to a single repository. One project can therefore hold items from several repositories. You can also add draft items, which are notes that exist only in the project until you convert them to issues.
Fields and views
Every item has fields. Some come from the issue, such as assignees, labels, and milestone. You can add custom fields:
- Single select, for example Status or Priority.
- Number, for example an estimate in points.
- Date, for example a target ship date.
- Iteration, for a repeating time box such as a two-week sprint.
A view is a saved way of looking at the same items. The three layouts are:
| Layout | Best for |
|---|---|
| Table | Sorting, grouping, and editing many fields at once |
| Board | Moving items between columns, such as Todo, In Progress, and Done |
| Roadmap | Seeing items on a timeline using date or iteration fields |
Each view keeps its own filter, sort, and grouping. A board view might use a filter like the one below, which reuses the search qualifiers you already know.
is:issue is:open assignee:@me label:bugHow an item moves through a project
Status is the field most teams use to track progress. By default, built-in workflows set it for you. A newly added item gets Todo, and an item whose issue is closed or whose pull request merges gets Done. You can turn these workflows on or off, and add others such as auto-adding items that match a filter.
A worked example
Suppose your team needs to ship a date-validation fix. You do the following:
- Create a project named "Release 1.4" from your organization's Projects tab, and choose the Board template.
- Add a Priority single select field with the values High, Medium, and Low.
- Add an Iteration field with two-week cycles.
- Add issue #42 and the other open issues from the milestone. In the project, press the plus button at the bottom of a column or use the "Add item" bar and search by number.
- Set Priority and Iteration for each item, then drag cards between columns as work progresses.
Because pull request #57 says Fixes #42, merging it closes the issue. The built-in workflow then moves the item to Done without anyone touching the board.
Common errors
- Looking for the project in the repository. Projects live at the user or organization level, though you can link one to a repository so it appears in that repository's Projects tab.
- Expecting items to appear automatically. Unless you enable the auto-add workflow, you must add issues yourself.
- Editing a draft item and expecting an issue. Draft items have no issue number until you convert them.
- Treating a view filter as deletion. Filtering hides items from that view only. They remain in the project.
Exercise
A pull request containing "Fixes #42" is merged. The issue is an item in your project with the built-in workflows enabled. What happens to the item's Status, and why?
Show answer
The issue closes because of the closing keyword, and the "item closed" and "pull request merged" workflows set the item's Status to Done. The project item points to the issue, so it reflects the state change without manual edits.
Exercise
You want to see all open bugs assigned to you, grouped by Priority, without changing what your teammates see. How do you do it?
Show answer
Create a new view (a table or board) and give it its own filter, such as "is:open label:bug assignee:@me", and group it by the Priority field. Each view stores its own filter and grouping, so other views stay unchanged.