I want to change the default issue labels. I tried modifying the code in the lib/gitlab/issues_labels.rb which I thought was where it was generating the default labels. however that didn't actually work. Does anyone know how to change the default labels that are created for a project?
Gitlab 5.2.0 (May 2013) introduced the "Ability to generate default labels set for issues".
It comes from commit 71647fd, with issues_labels.rb
labels = important_labels + warning_labels + neutral_labels + positive_labels
project.issues_default_label_list = labels
So modifying those labels lib/gitlab/issues_labels.rb
should indeed be the right solution, but you might have to completely stop/restart your Gitlab instance in order to see the changes, because they could be set when launching Gitlab, and not modified later (even if the code changes)..
Hello from the year 2020!
You can create a default set of labels for new projects in the admin area for your GitLab instance.
Once you've created a set of labels there, brand new projects will automatically have them available from the start, and you won't see the "Generate a default set of labels" button anymore.
For existing projects, it would be nice if the "Generate a default set of labels" button would use the set of tags you've defined in the admin area. But that is not the case.
For existing projects, when you click that button, you'll still get the set of "default" labels from lib/gitlab/issues_labels.rb
(the code looks a bit different in 2020, but they're still hard-coded), regardless of whether there are any site-wide labels set up in the admin area.
Edit: As of this writing, there are currently no open issues addressing this inconsistency, so if it's really bothering you, you could create one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With