Enforcing One Issue Template Across an Entire GitHub Organization
Your team uses GitHub Issues to track work. You want to enforce that all new issues include a specific set of labels based on the issue type (bug, feature, task). What is the most efficient way to achieve this?
⚠ Common exam trap
Candidates often confuse branch protection rules or repository rulesets (which manage code changes) with issue management features, or mistakenly think CODEOWNERS can assign labels instead of reviewers.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create YAML-based issue forms in the .github/ISSUE_TEMPLATE folder.
GitHub issue forms, defined as YAML files in the .github/ISSUE_TEMPLATE folder, allow you to create structured templates that can enforce required fields, including mandatory label assignments. When a user submits an issue via a form, the labels specified in the template are automatically applied, ensuring consistency without manual intervention or additional automation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure branch protection rules to require label assignments.
Why it's wrong here
Branch protection rules govern pull request merges and branch policies (e.g., required reviewers, status checks, or linear history); they have no mechanism to enforce or require label assignments on GitHub Issues, so this option is incorrect.
- ✗
Use a CODEOWNERS file to auto-assign labels.
Why it's wrong here
A CODEOWNERS file defines which individuals or teams are automatically requested for code review based on file paths in pull requests; it does not assign or manage labels on issues, and therefore cannot enforce label usage at issue creation.
- ✓
Create YAML-based issue forms in the .github/ISSUE_TEMPLATE folder.
Why this is correct
YAML-based issue forms in the `.github/ISSUE_TEMPLATE` folder allow you to define structured issue templates with fields and a `labels:` key that automatically applies specified labels when the form is submitted, enforcing consistent label assignment at issue creation.
- ✗
Set up a repository ruleset to restrict label modifications.
Why it's wrong here
Repository rulesets enforce policies on branches and tags—such as required pull request reviews, status checks, or signing—but they do not provide settings to restrict or enforce label modifications on issues, so this cannot ensure labels are assigned.
Go deeper
Related to this question
Learn chapter
Implementing Work Item Management and Agile Planning
Key term
Task
A Task in Azure DevOps is a predefined, reusable step that performs a specific action during a build or release pipeline, like compiling code or running tests.
Key term
Bug
A bug is an error, flaw, or fault in software that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.
About these practice questions
One of 696 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on AZ-400
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Your organization uses GitHub Enterprise and wants to enforce that all repositories have a consistent CODEOWNERS file. Which approach should you use to centrally manage this?
hard- A.Use repository rulesets to require that the CODEOWNERS file exists and has a specified pattern
- ✓ B.Create a CODEOWNERS file at the organization level
- C.Use a script to push CODEOWNERS to each repo manually
- D.Create a GitHub Actions workflow that runs on push to check CODEOWNERS
Why B: In GitHub Enterprise, you can create a special repository named `.github` at the organization level. A CODEOWNERS file stored in that repository is applied as a default to all repositories in the organization, providing centralized management. Repository rulesets cannot require that a file exists; they enforce branch/tag rules such as required reviews and status checks, but not file existence.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.