You can create default issue templates and a default configuration file for issue templates for your organization or personal account. For more information, see Creating a default community health file.
Creating issue templates
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.
-
In the "Features" section, under Issues, click Set up templates. You may need to enable Issues and refresh the page before you can see the button.
-
Use the Add template dropdown menu, and click on the type of template you'd like to create.
-
To preview or edit the template before committing it to the repository, next to the template, click Preview and edit.
-
To edit the template, click , and type in the fields to edit their contents.
-
To automatically set a default issue title, assign the issue to people with read access to the repository, or apply labels to issues raised from the template, use the fields under "Optional additional information." You can also add these details in the issue template with
title
,labels
, orassignees
in a YAML frontmatter format. -
When you're finished editing and previewing your template, click Propose changes in the upper right corner of the page.
-
In the "Commit message" field, type a commit message describing your changes.
-
Below the commit message fields, select whether to commit your template directly to the default branch, or to create a new branch and open a pull request. For more information about pull requests, see About pull requests.
-
Click Commit changes. Once these changes are merged into the default branch, the template will be available for contributors to use when they open new issues in the repository.
Creating issue forms
Note
Issue forms are currently in public preview and subject to change.
With issue forms, you can create issue templates that have customizable web form fields. You can encourage contributors to include specific, structured information by using issue forms in your repository. Issue forms are written in YAML using the GitHub form schema. For more information, see Syntax for GitHub's form schema. If you're new to YAML and want to learn more, see Learn YAML in Y minutes.
To use an issue form in your repository, you must create a new file and add it to the .github/ISSUE_TEMPLATE
folder in your repository.
Here is an example of an issue form configuration file.
name: Bug Report description: File a bug report. title: "[Bug]: " labels: ["bug", "triage"] projects: ["octo-org/1", "octo-org/44"] assignees: - octocat body: - type: markdown attributes: value: | Thanks for taking the time to fill out this bug report! - type: input id: contact attributes: label: Contact Details description: How can we get in touch with you if we need more info? placeholder: ex. [email protected] validations: required: false - type: textarea id: what-happened attributes: label: What happened? description: Also tell us, what did you expect to happen? placeholder: Tell us what you see! value: "A bug happened!" validations: required: true - type: dropdown id: version attributes: label: Version description: What version of our software are you running? options: - 1.0.2 (Default) - 1.0.3 (Edge) default: 0 validations: required: true - type: dropdown id: browsers attributes: label: What browsers are you seeing the problem on? multiple: true options: - Firefox - Chrome - Safari - Microsoft Edge - type: textarea id: logs attributes: label: Relevant log output description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. render: shell - type: checkboxes id: terms attributes: label: Code of Conduct description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com). options: - label: I agree to follow this project's Code of Conduct required: true
name: Bug Report
description: File a bug report.
title: "[Bug]: "
labels: ["bug", "triage"]
projects: ["octo-org/1", "octo-org/44"]
assignees:
- octocat
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. [email protected]
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- 1.0.2 (Default)
- 1.0.3 (Edge)
default: 0
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com).
options:
- label: I agree to follow this project's Code of Conduct
required: true
Here is the rendered version of the issue form.
- Choose a repository where you want to create an issue form. You can use an existing repository that you have write access to, or you can create a new repository. For more information about creating a repository, see Creating a new repository.
- In your repository, create a file called
.github/ISSUE_TEMPLATE/FORM-NAME.yml
, replacingFORM-NAME
with the name for your issue form. For more information about creating new files on GitHub, see