Issue Triage Automation
Intermediate10 min
Triage, label, and manage GitHub issues efficiently using CLI commands for faster project management.
Prerequisites
- -GitHub CLI (gh) installed and authenticated
Steps
1
List issues by label
View open issues filtered by a specific label.
$ gh issue list --label bug --state open --limit 20
2
Create an issue with labels and assignee
File a new issue with metadata pre-filled.
$ gh issue create --title 'Bug: login fails on Safari' --label bug,high-priority --assignee @me --body 'Steps to reproduce:\n1. Open Safari\n2. Navigate to /login\n3. Submit form'
3
Batch-label untriaged issues
Add a label to multiple issues at once using a loop.
$ gh issue list --label '' --state open --json number --jq '.[].number' | head -10 | xargs -I{} gh issue edit {} --add-label needs-triage
Filter carefully before batch-labeling to avoid mislabeling issues.
4
Close stale issues with a comment
Close old issues that have not had activity, with an explanatory comment.
$ gh issue close 123 --comment 'Closing due to inactivity. Please reopen if this is still relevant.'
5
Transfer an issue to another repository
Move an issue to a more appropriate repository.
$ gh issue transfer 123 owner/other-repo
Full Script
FAQ
Discussion
Loading comments...