- Add a template to be used in every issue for a specific project,
- Add a template to be used in every issue for a specific project,
giving instructions and guidelines, requiring for information specific to that subject.
giving instructions and guidelines, requiring for information specific to that subject.
...
@@ -40,7 +40,7 @@ To learn how to create templates for various file types in groups, visit
...
@@ -40,7 +40,7 @@ To learn how to create templates for various file types in groups, visit
- You can also create issues and merge request templates for different
- You can also create issues and merge request templates for different
stages of your workflow, for example, feature proposal, feature improvement, or a bug report.
stages of your workflow, for example, feature proposal, feature improvement, or a bug report.
## Create an issue template
## Creating issue templates
Create a new Markdown (`.md`) file inside the `.gitlab/issue_templates/`
Create a new Markdown (`.md`) file inside the `.gitlab/issue_templates/`
directory in your repository. Commit and push to your default branch.
directory in your repository. Commit and push to your default branch.
...
@@ -65,13 +65,13 @@ To create the `.gitlab/issue_templates` directory:
...
@@ -65,13 +65,13 @@ To create the `.gitlab/issue_templates` directory:
To check if this has worked correctly, [create a new issue](issues/managing_issues.md#create-a-new-issue)
To check if this has worked correctly, [create a new issue](issues/managing_issues.md#create-a-new-issue)
and see if you can choose a description template.
and see if you can choose a description template.
## Create a merge request template
## Creating merge request templates
Similarly to issue templates, create a new Markdown (`.md`) file inside the
Similarly to issue templates, create a new Markdown (`.md`) file inside the
`.gitlab/merge_request_templates/` directory in your repository. Commit and
`.gitlab/merge_request_templates/` directory in your repository. Commit and
push to your default branch.
push to your default branch.
## Use the templates
## Using the templates
Let's take for example that you've created the file `.gitlab/issue_templates/Bug.md`.
Let's take for example that you've created the file `.gitlab/issue_templates/Bug.md`.
This enables the `Bug` dropdown option when creating or editing issues. When
This enables the `Bug` dropdown option when creating or editing issues. When
...
@@ -80,46 +80,15 @@ to the issue description field. The **Reset template** button discards any
...
@@ -80,46 +80,15 @@ to the issue description field. The **Reset template** button discards any
changes you made after picking the template and returns it to its initial status.
changes you made after picking the template and returns it to its initial status.
NOTE:
NOTE:
You can create shortcut links to create an issue using a designated template.
You can create short-cut links to create an issue using a designated template. For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`.
For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`.
### Set an issue and merge request description template at instance level **(PREMIUM ONLY)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46222) in GitLab 13.8.
Similar to group templates, issue and merge request templates can also be set up at the instance level.
This results in those templates being available in all projects within the instance.
Only instance administrators can set instance-level templates.
To set the instance-level description template repository:
1. Select the **Admin Area** icon (**{admin}**).
1. Select **Templates**.
1. From the dropdown, select your template project as the template repository at instance level.
Learn more about [instance template repository](../admin_area/settings/instance_template_repository.md).
> - This feature was introduced before [description templates](#overview) and is available in [GitLab Starter](https://about.gitlab.com/pricing/). It can be enabled in the project's settings.
> - Templates for issues were [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28) in GitLab EE 8.1.
![Setting templates in the Admin Area](../admin_area/settings/img/file_template_admin_area.png)
> - Templates for merge requests were [introduced](https://gitlab.com/gitlab-org/gitlab/commit/7478ece8b48e80782b5465b96c79f85cc91d391b) in GitLab EE 6.9.
### Set a default template for merge requests and issues **(STARTER)**
> - This feature was introduced before [description templates](#description-templates) and is available in [GitLab Starter](https://about.gitlab.com/pricing/). It can be enabled in the project's settings.
> - Templates for issues [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28) in GitLab EE 8.1.
> - Templates for merge requests [introduced](https://gitlab.com/gitlab-org/gitlab/commit/7478ece8b48e80782b5465b96c79f85cc91d391b) in GitLab EE 6.9.
The visibility of issues and/or merge requests should be set to either "Everyone
The visibility of issues and/or merge requests should be set to either "Everyone
with access" or "Only Project Members" in your project's **Settings / Visibility, project features, permissions** section, otherwise the
with access" or "Only Project Members" in your project's **Settings / Visibility, project features, permissions** section, otherwise the
...
@@ -144,47 +113,52 @@ pre-filled with the text you entered in the template(s).
...
@@ -144,47 +113,52 @@ pre-filled with the text you entered in the template(s).
## Description template example
## Description template example
We make use of description templates for issues and merge requests in the GitLab project.
We make use of Description Templates for Issues and Merge Requests within the GitLab Community
Please refer to the [`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab)
Edition project. Please refer to the [`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab)
for some examples.
for some examples.
NOTE:
NOTE:
It's possible to use [quick actions](quick_actions.md) in description templates to quickly add
It's possible to use [quick actions](quick_actions.md)within description templates to quickly add
labels, assignees, and milestones. The quick actions are only executed if the user submitting
labels, assignees, and milestones. The quick actions are only executed if the user submitting
the issue or merge request has the permissions to perform the relevant actions.
the issue or merge request has the permissions to perform the relevant actions.
Here is an example of a Bug report template:
Here is an example of a Bug report template:
```markdown
```plaintext
## Summary
Summary
(Summarize the bug encountered concisely)
(Summarize the bug encountered concisely)
## Steps to reproduce
Steps to reproduce
(How one can reproduce the issue - this is very important)
(How one can reproduce the issue - this is very important)
## Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic
Example Project
behaviour, and link to it here in the bug report.
If you are using an older version of GitLab, this will also determine whether the bug has been fixed
(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
in a more recent version)
## What is the current bug behavior?
(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
What is the current bug behavior?
(What actually happens)
(What actually happens)
## What is the expected correct behavior?
What is the expected correct behavior?
(What you should see instead)
(What you should see instead)
## Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code, as
Relevant logs and/or screenshots
it's very hard to read otherwise.)
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
## Possible fixes
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
(If you can, link to the line of code that might be responsible for the problem)
%p#issue-settings-default-template-label=_('Set a default description template to be used for new issues. %{link_start}What are description templates?%{link_end}').html_safe%{link_start: link_start,link_end: '</a>'.html_safe}
%p#issue-settings-default-template-label=_('Set a default description template to be used for new issues. %{link_start}What are description templates?%{link_end}').html_safe%{link_start: link_start,link_end: '</a>'.html_safe}