MCPcopy Create free account
hub / github.com/cli/cli / lookupIssueTypeID

Function lookupIssueTypeID

pkg/cmd/issue/edit/edit.go:556–567  ·  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

554// lookupIssueTypeID resolves the chosen issue type to its node ID using the
555// map populated by FetchOptions.
556func lookupIssueTypeID(editable *prShared.Editable) (string, error) {
557 if !editable.IssueType.Edited || editable.IssueType.Value == "" {
558 return "", nil
559 }
560 id, ok := editable.IssueTypeNameToID[editable.IssueType.Value]
561 if !ok {
562 return "", fmt.Errorf("type %q not found; available types: %s",
563 editable.IssueType.Value,
564 strings.Join(editable.IssueType.Options, ", "))
565 }
566 return id, nil
567}
568
569func deferredUpdateIssueOptions(client *api.Client, baseRepo ghrepo.Interface, issue *api.Issue, editOpts *EditOptions, issueTypeID string) (api.DeferredUpdateIssueOptions, error) {
570 updateOpts := api.DeferredUpdateIssueOptions{

Callers 1

editRunFunction · 0.85

Calls 2

JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected