Allow template selection when using 'Populate issue description' feature

Problem

When using GitLab Duo to generate an issue description, users cannot leverage existing issue templates that may be configured for their project. This means the generated descriptions don't follow established project conventions or include required sections that templates would normally provide.

Proposal

Enhance the "Generate issue description" feature to allow users to select an issue template that will be used as a framework for the AI-generated content.

User Experience

  1. User clicks the "GitLab Duo" button on the issue description toolbar
  2. User clicks "Generate issue description"
  3. The resulting modal includes an optional dropdown showing available issue templates for the project
  4. If a template is selected, it gets injected into the prompt sent to the AI model
  5. The generated description uses the selected template as a structural framework while populating it with AI-generated content based on the user's input

Benefits

  • Maintains consistency with project conventions and required sections
  • Combines the efficiency of AI generation with the structure of established templates
  • Reduces manual work of applying templates after AI generation
  • Ensures compliance with project-specific issue requirements

Implementation Considerations

  • The template should be used as a framework/structure rather than replacing the AI-generated content entirely
  • The AI should populate template sections with relevant content based on the user's summary input
  • If no template is selected, the current behavior should remain unchanged
  • Consider how to handle template variables/placeholders in the AI generation process

Related Issues

  • #474141 - Allow using description generation when editing an issue
Edited by 🤖 GitLab Bot 🤖