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

Function lookupIssueTypeID

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

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

Callers 1

editRunFunction · 0.85

Calls 2

JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected