5 min read • Guide 50 of 877
Automating Task Status with PR Merges
Developers shouldn't have to update task status manually after merging code. GitScrum's Git integration automatically moves tasks through workflow stages based on PR activity, keeping project state accurate without developer overhead.
The Manual Update Problem
| Without Automation | With Automation |
|---|---|
| Developer opens PR | Developer opens PR |
| Developer updates task to "Review" | Task auto-moves to "Review" |
| Reviewer approves | Reviewer approves |
| Developer updates task | Task auto-labeled "approved" |
| Developer merges PR | Developer merges PR |
| Developer updates task to "Done" | Task auto-moves to "Done" |
| 5 manual updates | 0 manual updates |
Setting Up Git Integration
Connection Setup
GIT INTEGRATION SETUP
═════════════════════
Step 1: Connect Repository
──────────────────────────
Platform: GitHub / GitLab / Bitbucket
Repository: company/product
Authentication: OAuth or Personal Access Token
Step 2: Configure Task ID Pattern
─────────────────────────────────
Pattern: #(\d+)
Example matches: #123, #456
Alternative: TASK-(\d+) for TASK-123 format
Step 3: Enable Webhooks
───────────────────────
Events to track:
├── Branch created
├── Pull request opened
├── Pull request approved
├── Pull request merged
└── Pull request closed
Automation Rules
AUTOMATION RULES
════════════════
RULE 1: Branch Created
──────────────────────
Trigger: Branch name contains task ID
Action: Move task to "In Progress"
Example: feature/#123-user-auth → Task #123 to In Progress
RULE 2: PR Opened
─────────────────
Trigger: PR description contains task ID
Action:
├── Move task to "In Review"
├── Link PR to task
└── Notify assigned reviewer
RULE 3: PR Approved
───────────────────
Trigger: PR receives required approvals
Action: Add "approved" label to task
RULE 4: PR Merged
─────────────────
Trigger: PR merged to main/master
Action: Move task to "Done"
RULE 5: PR Closed Without Merge
───────────────────────────────
Trigger: PR closed without merging
Action: Move task back to "In Progress"
Linking PRs to Tasks
In Branch Names
BRANCH NAMING CONVENTIONS
═════════════════════════
Format: type/#task-id-short-description
Examples:
├── feature/#123-user-authentication
├── bugfix/#456-login-redirect-loop
├── hotfix/#789-security-patch
└── refactor/#234-cleanup-auth-module
GitScrum extracts: #123, #456, #789, #234
In PR Descriptions
PR DESCRIPTION TEMPLATE
═══════════════════════
## Description
Brief description of changes
## Related Tasks
Closes #123
Related to #124
## Type
- [x] Feature
- [ ] Bug fix
- [ ] Refactor
## Checklist
- [x] Tests added
- [x] Documentation updated
---
GitScrum detects: #123, #124
Workflow Integration
Complete Flow
DEVELOPER WORKFLOW
══════════════════
1. Pick task #123 from board
└── Task already in "Ready"
2. Create branch: feature/#123-user-auth
└── Task auto-moves to "In Progress"
3. Write code, commit, push
└── Task stays in "In Progress"
4. Open PR mentioning #123
└── Task auto-moves to "In Review"
└── PR linked to task
5. Reviewer approves
└── Task labeled "approved"
6. Merge PR
└── Task auto-moves to "Done"
└── PR shows as merged on task
No manual status updates needed!
Multiple Tasks per PR
MULTI-TASK PR
═════════════
PR Description:
"Implements user authentication system
Closes #123 (auth flow)
Closes #124 (password reset)
Related #125 (future: 2FA)"
Result:
├── #123 → Done (when merged)
├── #124 → Done (when merged)
└── #125 → Unchanged (related, not closed)
Troubleshooting
Common Issues
TROUBLESHOOTING GUIDE
═════════════════════
TASK NOT UPDATING?
──────────────────
Check:
├── Is task ID format correct? (#123 not #123)
├── Is webhook enabled?
├── Is repository connected?
└── View integration logs in settings
WRONG TASK UPDATED?
───────────────────
Check:
├── Correct task ID in branch/PR?
├── Multiple tasks with same ID pattern?
└── Manual override available
PR NOT LINKED?
──────────────
Fix:
├── Edit PR description to add task ID
├── Or manually link from task page
└── Automation triggers on description update
Best Practices
For Smooth Automation
- Consistent branch naming — Enforce with Git hooks
- Always include task ID — In branch or PR description
- One task per branch — When possible for clarity
- Use keywords — "Closes", "Fixes", "Resolves" for auto-close
- Review integration logs — Catch issues early
Anti-Patterns
AVOID THESE:
✗ Branches without task IDs
✗ Typos in task IDs
✗ Manual status updates (defeats purpose)
✗ Ignoring failed automations
✗ Multiple unrelated tasks in one PR