feat(update): add --type flag to bd update command (GH#522)
Allow changing an issue type (bug, feature, task, epic, chore) via the bd update command. The storage layer already supported issue_type in allowedUpdateFields, this just exposes it through the CLI. Changes: - Add --type/-t flag to updateCmd in show.go - Add IssueType field to UpdateArgs in protocol.go - Handle issue_type in updatesFromArgs in server_issues_epics.go - Add validation using ParseIssueType before update Example usage: bd update ab-xyz --type epic Fixes: #522
This commit is contained in:
@@ -87,6 +87,7 @@ type UpdateArgs struct {
|
||||
Assignee *string `json:"assignee,omitempty"`
|
||||
ExternalRef *string `json:"external_ref,omitempty"` // Link to external issue trackers
|
||||
EstimatedMinutes *int `json:"estimated_minutes,omitempty"` // Time estimate in minutes
|
||||
IssueType *string `json:"issue_type,omitempty"` // Issue type (bug, feature, task, epic, chore)
|
||||
AddLabels []string `json:"add_labels,omitempty"`
|
||||
RemoveLabels []string `json:"remove_labels,omitempty"`
|
||||
SetLabels []string `json:"set_labels,omitempty"`
|
||||
|
||||
@@ -73,6 +73,9 @@ func updatesFromArgs(a UpdateArgs) map[string]interface{} {
|
||||
if a.EstimatedMinutes != nil {
|
||||
u["estimated_minutes"] = *a.EstimatedMinutes
|
||||
}
|
||||
if a.IssueType != nil {
|
||||
u["issue_type"] = *a.IssueType
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user