{"record":{"id":"61cced96c0d251ea","repo":"mislav/hub","slug":"error-no-milestone-found-with-name-s","errorCode":null,"errorMessage":"error: no milestone found with name '%s'","messagePattern":"error: no milestone found with name '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/issue.go","lineNumber":848,"sourceCode":"\tif value == \"\" {\n\t\treturn 0, nil\n\t}\n\n\tif milestoneNumber, err := strconv.Atoi(value); err == nil {\n\t\treturn milestoneNumber, nil\n\t}\n\n\tmilestones, err := client.FetchMilestones(project)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tfor _, milestone := range milestones {\n\t\tif strings.EqualFold(milestone.Title, value) {\n\t\t\treturn milestone.Number, nil\n\t\t}\n\t}\n\n\treturn 0, fmt.Errorf(\"error: no milestone found with name '%s'\", value)\n}\n\nfunc transferIssue(cmd *Command, args *Args) {\n\tif args.ParamsSize() < 2 {\n\t\tutils.Check(cmd.UsageError(\"\"))\n\t}\n\n\tlocalRepo, err := github.LocalRepo()\n\tutils.Check(err)\n\n\tproject, err := localRepo.MainProject()\n\tutils.Check(err)\n\n\tissueNumber, err := strconv.Atoi(args.GetParam(0))\n\tutils.Check(err)\n\ttargetOwner := project.Owner\n\ttargetRepo := args.GetParam(1)\n\tif strings.Contains(targetRepo, \"/\") {","sourceCodeStart":830,"sourceCodeEnd":866,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/issue.go#L830-L866","documentation":"`milestoneValueToNumber` resolves a milestone given by name to its number by case-insensitively comparing against all milestones fetched for the repository. If no milestone title matches the provided value, it returns this error. The lookup is exact-modulo-case: partial names or numbers-as-strings do not match.","triggerScenarios":"Passing `--milestone <name>` to `gh issue` (listIssues), `setMilestoneFromArgs`, or via `pullRequest` where `<name>` matches no milestone title in the repo (case-insensitive).","commonSituations":"Typos or partial names (`v1` vs `v1.0`); the milestone was deleted or renamed; targeting the wrong repository which has different milestones; passing a milestone number where a title is expected.","solutions":["List milestones (`gh milestone list` or web UI) and use the exact title, e.g. `--milestone \"v1.0\"`.","Check you are in the intended repository — milestone lookup is repo-scoped.","If the milestone was renamed/deleted, update scripts to the current title or recreate it."],"exampleFix":"// before\ngh issue list --milestone \"v1\"      // no milestone titled v1\n// after\ngh issue list --milestone \"v1.0\"    // exact existing title","handlingStrategy":"validation","validationCode":"milestones := fetchMilestones(repo)\nvar match *github.Milestone\nfor _, m := range milestones {\n    if strings.EqualFold(m.Title, wanted) {\n        match = &m\n        break\n    }\n}\nif match == nil {\n    fmt.Fprintf(os.Stderr, \"milestone %q not found; available:\\n\", wanted)\n    for _, m := range milestones {\n        fmt.Println(\" -\", m.Title)\n    }\n    os.Exit(2)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact milestone titles from `gh milestone list` (case-insensitive, no partials).","Confirm the repository context — milestones are repo-scoped.","Update automation when milestones are renamed or deleted."],"tags":["milestone","not-found","cli-usage"],"backgroundTag":"resource-not-found-by-name","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}