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