summaryrefslogtreecommitdiff
path: root/app/helpers/issuables_description_templates_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/issuables_description_templates_helper.rb')
-rw-r--r--app/helpers/issuables_description_templates_helper.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/helpers/issuables_description_templates_helper.rb b/app/helpers/issuables_description_templates_helper.rb
index 6c23f888823..a82a5ac0fb0 100644
--- a/app/helpers/issuables_description_templates_helper.rb
+++ b/app/helpers/issuables_description_templates_helper.rb
@@ -38,7 +38,13 @@ module IssuablesDescriptionTemplatesHelper
# Only local templates will be listed if licenses for inherited templates are not present
all_templates = all_templates.values.flatten.map { |tpl| tpl[:name] }.compact.uniq
- all_templates.find { |tmpl_name| tmpl_name == params[:issuable_template] }
+ template = all_templates.find { |tmpl_name| tmpl_name == params[:issuable_template] }
+
+ unless issuable.description.present?
+ template ||= all_templates.find { |tmpl_name| tmpl_name.casecmp?('default') }
+ end
+
+ template
end
def available_service_desk_templates_for(project)