updateFeature
codebolt.roadmap.updateFeature(featureId: string, data: UpdateFeatureData, projectPath: string): Promise<RoadmapFeatureResponse>
Updates an existing feature's information. Only the specified fields are updated; other fields remain unchanged.
Parameters
featureId(string): The ID of the feature to updatedata(UpdateFeatureData): Partial feature data with fields to updateprojectPath(string): Optional project path (uses active project if not provided)
Returns
Promise<[RoadmapFeatureResponse](/docs/reference/type-reference/codeboltjs/interfaces/RoadmapFeatureResponse)>: A promise that resolves to the updated feature
Parameter Details
featureId(string, required): The ID of the feature to updatedata(UpdateFeatureData, required): Partial feature data (all fields optional)title(string, optional): Updated feature titledescription(string, optional): Updated feature descriptionimpact(ImpactLevel, optional): Updated impact leveldifficulty(DifficultyLevel, optional): Updated difficulty levelpriority(number, optional): Updated prioritytags(string[], optional): Updated tagscategory(string, optional): Updated categorystatus(FeatureStatus, optional): Updated status
Response Structure
interface RoadmapFeatureResponse {
feature: Feature;
}
Examples
1. Update Feature Status
import codebolt from '@codebolt/codeboltjs';
// Update feature status to in-progress
const result = await codebolt.roadmap.updateFeature('feat_001', {
status: 'in-progress'
});
console.log('Feature status updated:', result.feature.status);
2. Update Multiple Fields
// Update multiple feature properties
const result = await codebolt.roadmap.updateFeature('feat_001', {
title: 'User Authentication & Authorization',
description: 'Updated: Added OAuth2 support and role-based access control',
impact: 'critical',
priority: 1
});
console.log('Feature updated');
3. Mark Feature as Complete
// Mark feature as completed
const result = await codebolt.roadmap.updateFeature('feat_001', {
status: 'completed'
});
console.log('Feature completed!');
console.log('Updated at:', result.feature.updatedAt);
4. Update Feature Priority
// Change feature priority
const result = await codebolt.roadmap.updateFeature('feat_001', {
priority: 5
});
console.log('Priority updated to:', result.feature.priority);
5. Add Tags to Feature
// Add tags to existing feature
const currentFeature = await codebolt.roadmap.getFeatures('phase_001');
const feature = currentFeature.features.find(f => f.id === 'feat_001');
const result = await codebolt.roadmap.updateFeature('feat_001', {
tags: [...(feature.tags || []), 'urgent', 'backend']
});
console.log('Tags updated:', result.feature.tags);
6. Update Feature During Development
// Progressively update feature as work progresses
async function updateFeatureProgress(featureId: string) {
// Start work
await codebolt.roadmap.updateFeature(featureId, {
status: 'in-progress'
});
// Work on feature...
// Complete feature
await codebolt.roadmap.updateFeature(featureId, {
status: 'completed'
});
console.log('Feature workflow complete');
}
7. Update Impact Assessment
// Reassess and update impact
const result = await codebolt.roadmap.updateFeature('feat_001', {
impact: 'high',
difficulty: 'medium'
});
console.log('Impact and difficulty updated');
8. Update Feature Description
// Update with more detailed description
const result = await codebolt.roadmap.updateFeature('feat_001', {
description: `
## User Authentication
Implement secure user authentication with:
- Email/password registration and login
- OAuth2 integration (Google, GitHub)
- Password reset via email
- Session management
- Remember me functionality
- Multi-factor authentication (optional)
## Security Considerations
- Password hashing with bcrypt
- Rate limiting on auth endpoints
- CSRF protection
- Secure session storage
`.trim()
});
console.log('Description updated with details');
9. Cancel Feature
// Cancel a feature that's no longer needed
const result = await codebolt.roadmap.updateFeature('feat_001', {
status: 'cancelled',
tags: [...(result.feature.tags || []), 'deprecated']
});
console.log('Feature cancelled');
10. Batch Update Features
// Update multiple features in a phase
async function batchUpdateFeatures(featureIds: string[], updates: any) {
for (const id of featureIds) {
await codebolt.roadmap.updateFeature(id, updates);
console.log(`✓ Updated: ${id}`);
}
}
// Usage - mark all phase features as in-progress
const phaseFeatures = await codebolt.roadmap.getFeatures('phase_001');
const featureIds = phaseFeatures.features.map(f => f.id);
await batchUpdateFeatures(featureIds, { status: 'in-progress' });
Common Use Cases
Status Workflow:
// Standard feature workflow
async function featureWorkflow(featureId: string) {
// Pending -> In Progress
await codebolt.roadmap.updateFeature(featureId, {
status: 'in-progress'
});
// Work on feature...
// In Progress -> Completed
await codebolt.roadmap.updateFeature(featureId, {
status: 'completed'
});
}
Priority Rebalancing:
// Rebalance priorities based on changes
async function reprioritizeFeatures(featureIds: string[]) {
for (let i = 0; i < featureIds.length; i++) {
await codebolt.roadmap.updateFeature(featureIds[i], {
priority: i + 1
});
}
}
Add Progress Notes:
// Append progress notes to description
async function addProgressNote(featureId: string, note: string) {
const feature = await getFeatureDetails(featureId);
const updatedDesc = `${feature.description}\n\n## Update\n${note}\n*Updated: ${new Date().toISOString()}*`;
await codebolt.roadmap.updateFeature(featureId, {
description: updatedDesc.trim()
});
}
Notes
- Only specified fields are updated
- Omitted fields remain unchanged
- Status transitions can be validated at application level
- Tags are replaced, not appended (get current tags first if appending)
- Priority change affects sort order
- Status changes update the timestamp
- Feature ID is immutable
- Phase association cannot be changed (use moveFeature instead)
- Can be called multiple times for incremental updates
- Updates are reflected immediately in queries