From ed7a2bbcd6a549f6f5444eb637d7940bc5ce6255 Mon Sep 17 00:00:00 2001 From: 15972095207 <2484216370@qq.com> Date: Thu, 4 Jun 2026 08:59:33 +0800 Subject: [PATCH] feat: support multiple labels in issue create (--label id1,id2) Co-Authored-By: Claude Opus 4.8 --- shortcuts/issue/issue.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/shortcuts/issue/issue.go b/shortcuts/issue/issue.go index 8a6e6f9..d38e529 100644 --- a/shortcuts/issue/issue.go +++ b/shortcuts/issue/issue.go @@ -82,12 +82,18 @@ func Shortcuts() []*common.Shortcut { if m := ctx.Arg("milestone"); m != "" { body["fixed_version_id"] = m } - if l := ctx.Arg("label"); l != "" { - body["issue_tag_ids"] = []int{func() int { - id, _ := strconv.Atoi(l) - return id - }()} - } + if l := ctx.Arg("label"); l != "" { + var tagIDs []int + for _, s := range strings.Split(l, ",") { + s = strings.TrimSpace(s) + if id, err := strconv.Atoi(s); err == nil { + tagIDs = append(tagIDs, id) + } + } + if len(tagIDs) > 0 { + body["issue_tag_ids"] = tagIDs + } + } env, err := ctx.CallAPI("POST", v1RepoPath(ctx)+"/issues", body) if err != nil { return err