Gitlab Description Templates
Tags: gitlab, github, collaboration
Published: 2019-11-10 00:09:10

---
title: Gitlab Description Templates
published: true
date: 2019-10-10 00:00:00 UTC
tags: gitlab, github, collaboration
canonical_url: https://stephencharlesweiss.com//2019-10-10/description-templates/
---

We use templates to help write descriptive tickets or MRs on various projects at work.<sup>1</sup> Then I started working on a new project and when I reached for them, I found the templates hadn’t been set up.

I didn’t realize just how much I liked them until I found myself in a position where they weren’t available. I took their absence as an opportunity. I set out to set up some basic ones and get the process started for the team.

To do that, however, I needed to learn a few things. It turns out that there are multiple types of templates (issues _and_ merge requests) and that they can have some levels of automation built into them (through quick actions<sup>2</sup> on Gitlab).

The actual creation of the process is very straightforward:

1. Create a directory in your project `.gitlab/issue_templates/` or `.gitlab/merge_request_templates` depending on the template type you’re interested in.
2. Create a Markdown (`.md`) file with the template. Name it how you’d like the template to appear in the UI. 
3. Push the changes to the `repo` and merge them into Master.

Once that’s done, you should have templates available.

## <svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Parting Thoughts

First, While we use Gitlab at work, it turns out that Github has nearly identical capabilities.<sup>3,4</sup>.

Secondly, I loved the motivation for the feature. According to Gitlab:

> We all know that a properly submitted issue is more likely to be addressed in a timely manner by the developers of a project.  
> Description templates allow you to define context-specific templates for issue and merge request description fields for your project, as well as help filter out a lot of unnecessary noise from issues.

So true. Now, go forth and create better tickets powered by templates.

## <svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Footnotes

- <sup>1</sup> In Gitlab parlance, these are actually called Description Templates. [Description templates | GitLab](https://docs.gitlab.com/ee/user/project/description_templates.html)
- <sup>2</sup> [GitLab Quick Actions | GitLab](https://docs.gitlab.com/ee/user/project/quick_actions.html)
- <sup>3</sup> [Creating issue templates for your repository | GitHub Help](https://help.github.com/en/articles/creating-issue-templates-for-your-repository)
- <sup>4</sup> [Creating a pull request template for your repository | GitHub Help](https://help.github.com/en/articles/creating-a-pull-request-template-for-your-repository)