MCPcopy
hub / github.com/cli/cli / lookupIssueTypeID

Function lookupIssueTypeID

pkg/cmd/issue/edit/edit.go:462–473  ·  view source on GitHub ↗

lookupIssueTypeID resolves the chosen issue type to its node ID using the map populated by FetchOptions.

(editable *prShared.Editable)

Source from the content-addressed store, hash-verified

460// lookupIssueTypeID resolves the chosen issue type to its node ID using the
461// map populated by FetchOptions.
462func lookupIssueTypeID(editable *prShared.Editable) (string, error) {
463 if !editable.IssueType.Edited || editable.IssueType.Value == "" {
464 return "", nil
465 }
466 id, ok := editable.IssueTypeNameToID[editable.IssueType.Value]
467 if !ok {
468 return "", fmt.Errorf("type %q not found; available types: %s",
469 editable.IssueType.Value,
470 strings.Join(editable.IssueType.Options, ", "))
471 }
472 return id, nil
473}
474
475func deferredUpdateIssueOptions(client *api.Client, baseRepo ghrepo.Interface, issue *api.Issue, editOpts *EditOptions, issueTypeID string) (api.DeferredUpdateIssueOptions, error) {
476 updateOpts := api.DeferredUpdateIssueOptions{

Callers 1

editRunFunction · 0.85

Calls 2

JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected