Use project settings template for new work items

What does this MR do and why?

When creating work items outside the standard create flow (issue board, epic child item, WorkItemCreate GraphQL mutation), assign_description_from_template only checked the repository Default.md, ignoring project.issues_template (project settings template) which should take priority per the documented priority order.

The fix overrides assign_description_from_template in EE: when issues_template is set and licensed, the method is a no-op, leaving params[:description] unset. This lets BuildService#issue_params_from_template — which already handles this correctly via its else branch — apply the project settings template without concatenating a repo template.

How to set up and validate locally

Requires a license with the issuable_default_templates feature (Premium/Ultimate).

  1. Create a project and add a repo template at .gitlab/issue_templates/Default.md, e.g. Repo template content.
  2. In the project's Settings > General > Issues, set the "Default description template for issues" (issues_template) to something distinct, e.g. Project settings template.
  3. Create a work item through one of the non-standard flows, since the bug doesn't reproduce through the normal "New issue" form:
    • From an issue board, click + to create an issue in a list.
    • From an epic, add a new child issue/task.
    • Or call the WorkItemCreate GraphQL mutation directly for the project, without passing a description.
  4. Before this fix: the created item's description is the repo Default.md content (or the repo template concatenated with the project template).
  5. After this fix: the created item's description is exactly the project settings template (Project settings template), matching the documented priority order.
  6. Confirm the existing/added specs pass: bundle exec rspec ee/spec/services/ee/issues/create_service_spec.rb

References

Edited by Aryann Dwivedi

Merge request reports

Loading
Loading