Problem
When a new application is submitted, the candidates need to manually specify the role in the title. This creates inconsistency and makes application filtering harder.
Solution
To automatically assign labels to issues created from this template, you need to add a labels field to your issue template.
Auto-assign Fixed Label
Add a labels field at the top level of the template. These labels will be automatically assigned:
...
labels: ["job-application"] # These are auto-assigned
...
## Let Users Select Labels
Unfortunately, **GitHub doesn't natively support a dropdown field in issue templates that auto-assigns labels**. However, you can work around this by:
1. **Adding a dropdown field** for users to select their department/team:
```yaml
- type: dropdown
id: department
attributes:
label: "Department"
description: "Select your department (this helps with routing)"
options:
- Engineering
- Marketing
- Design
- Sales & Business Dev
validations:
required: true
- Then use a GitHub Action to automatically assign labels based on the selected value. Extend existing workflow (
.github/workflows/comment-bot.yml):
# This is pseudo code
name: Auto-label Job Applications
on:
issues:
types: [opened]
jobs:
label:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'job-application')
steps:
- uses: actions/github-script@v7
with:
script: |
const body = context.payload.issue.body;
const departmentMatch = body.match(/### Department\n\n(.*?)(?:\n|$)/);
if (departmentMatch) {
const department = departmentMatch[1].trim();
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: [department.toLowerCase().replace(/\s+/g, '-')]
});
}
Problem
When a new application is submitted, the candidates need to manually specify the role in the title. This creates inconsistency and makes application filtering harder.
Solution
To automatically assign labels to issues created from this template, you need to add a
labelsfield to your issue template.Auto-assign Fixed Label
Add a
labelsfield at the top level of the template. These labels will be automatically assigned:.github/workflows/comment-bot.yml):