mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-25 20:15:37 +02:00
feat(cli): add --parent flag to issue update command
Allows setting or clearing an issue's parent via the CLI: multica issue update <id> --parent <parent-id> multica issue update <id> --parent "" # clear parent
This commit is contained in:
@@ -162,6 +162,7 @@ func init() {
|
||||
issueUpdateCmd.Flags().String("assignee", "", "New assignee name (member or agent)")
|
||||
issueUpdateCmd.Flags().String("project", "", "Project ID")
|
||||
issueUpdateCmd.Flags().String("due-date", "", "New due date (RFC3339 format)")
|
||||
issueUpdateCmd.Flags().String("parent", "", "Parent issue ID (use --parent \"\" to clear)")
|
||||
issueUpdateCmd.Flags().String("output", "json", "Output format: table or json")
|
||||
|
||||
// issue status
|
||||
@@ -444,6 +445,14 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {
|
||||
body["assignee_type"] = aType
|
||||
body["assignee_id"] = aID
|
||||
}
|
||||
if cmd.Flags().Changed("parent") {
|
||||
v, _ := cmd.Flags().GetString("parent")
|
||||
if v == "" {
|
||||
body["parent_issue_id"] = nil
|
||||
} else {
|
||||
body["parent_issue_id"] = v
|
||||
}
|
||||
}
|
||||
|
||||
if len(body) == 0 {
|
||||
return fmt.Errorf("no fields to update; use flags like --title, --status, --priority, --assignee, etc.")
|
||||
|
||||
Reference in New Issue
Block a user