GitHub recently announced new features and support for multiple issue templates. Before, GitHub supported a single template, by supporting multiple types of issues, we can gather the right information from the beginning.
When we create multiple issue templates, users will be prompted to specify the type of issue they want to create. We can target specific questions or information requests for specific types of issues.
GitHub provides two pre-created templates, bug report and feature request. These pre-created templates suit most situations. Bug report issues can focus on reproduction, expected behavior and other troubleshooting information. Feature request templates can focus on understanding the what, how and why a new feature is required. You can also create your own templates for other situations, you don’t have to use what GitHub provides.
I've updated my Plaster template for PowerShell modules to contain a bug report and feature request template. I modified GitHub’s template to ask for things like: • PowerShell transcripts. • Operating System and PowerShell versions. • A list of any other modules that might imported.
You can create templates via the GitHub interface, or simply include them in the ISSUE_TEMPLATE folder in your repository. You can also create the templates yourself. You need to include the name and a description for each template. Much like this:
---
name: Bug report
about: Create a report to help us improve
---
So, what do the new templates look like for a user? If you select Issues > New Issue, you can now select what kind of issue you'd like to raise. In the case in the image, we can choose bug report or feature request. Users can opt for “Open a regular issue”, in this case GitHub will use ISSUE_TEMPLATE.MD
.
You can also define multiple pull request templates in the same manner. Simply put each template into the PULL_REQUEST_TEMPLATE
folder. The experience is like creating an Issue. I'm creating different pull request templates for Planet PowerShell, so we can correctly track changes.
If you want to start using these templates as part of your Plaster templates, you can see my examples over at my Plaster template.