Issue Templates
Issue templates let repository maintainers define structured forms for creating issues. When contributors create an issue using a template, the title, body, labels, and assignees are pre-filled based on the template definition. This ensures consistency and reduces the burden on contributors to remember what information to include.How Issue Templates Work
Issue templates are Markdown files stored in the.jjhub/ISSUE_TEMPLATE/ directory at the root of your repository. Each file defines a single template with YAML frontmatter for metadata and Markdown content for the issue body.
When a user creates an issue with --template, the CLI fetches the template from the repository, pre-fills the issue fields, and lets the user edit before submitting.
Template File Format
Each template file is a Markdown file (.md) with YAML frontmatter. The frontmatter defines metadata like the title, labels, and assignees. The Markdown body becomes the issue body, typically containing a structured form with sections to fill in.
Frontmatter Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name of the template |
description | string | No | Short description shown when listing templates |
title | string | No | Default issue title (can contain placeholders) |
labels | string[] | No | Labels to automatically apply to the issue |
assignees | string[] | No | Usernames to automatically assign |
Example Template
Create a file at.jjhub/ISSUE_TEMPLATE/bug-report.md:
More Template Examples
Feature request (.jjhub/ISSUE_TEMPLATE/feature-request.md):
.jjhub/ISSUE_TEMPLATE/docs.md):
CLI Usage
Creating an Issue from a Template
Use the--template flag (short: -T) with jjhub issue create to use a template:
--template flag accepts the template filename without the .md extension. For example, a template at .jjhub/ISSUE_TEMPLATE/bug-report.md is referenced as bug-report.
When you use --template, the template’s default title, labels, and assignees are applied. Any flags you pass explicitly (like --title or --assignee) override the template defaults.
Listing Available Templates
To see what templates are available for a repository:API
List Issue Templates
Retrieve all issue templates defined in a repository.200 OK):
.jjhub/ISSUE_TEMPLATE/ directory on the repository’s default bookmark, parses the YAML frontmatter, and returns the structured template data.
Directory Structure
Templates must be placed in the.jjhub/ISSUE_TEMPLATE/ directory at the repository root:
ISSUE_TEMPLATE is case-sensitive and must be uppercase. Template files must have the .md extension.
Best Practices
- Keep templates focused. Each template should serve a single purpose (bug report, feature request, documentation issue, etc.).
- Use descriptive filenames. The filename (without extension) is what users pass to
--template, so make it memorable and clear. - Include placeholder text. Use descriptive placeholder text in each section so contributors know what information to provide.
- Apply labels automatically. Use the
labelsfrontmatter field to categorize issues at creation time, reducing manual triage work. - Set a default title prefix. Use the
titlefield with a prefix like[Bug]:to make issues scannable in lists. - Keep the template list short. Three to five templates covers most projects. Too many templates creates decision fatigue.