lookupIssueTypeID resolves the chosen issue type to its node ID using the map populated by FetchOptions.
(editable *prShared.Editable)
| 554 | // lookupIssueTypeID resolves the chosen issue type to its node ID using the |
| 555 | // map populated by FetchOptions. |
| 556 | func 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 | |
| 569 | func deferredUpdateIssueOptions(client *api.Client, baseRepo ghrepo.Interface, issue *api.Issue, editOpts *EditOptions, issueTypeID string) (api.DeferredUpdateIssueOptions, error) { |
| 570 | updateOpts := api.DeferredUpdateIssueOptions{ |