Add adds a sub-issue to the specified issue. The sub-issue to be added must belong to the same repository owner as the parent issue. To replace the existing parent of a sub-issue, set replaceParent to true. GitHub API docs: https://docs.github.com/rest/issues/sub-issues?apiVersion=2022-11-28#add-s
(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest)
| 101 | // |
| 102 | //meta:operation POST /repos/{owner}/{repo}/issues/{issue_number}/sub_issues |
| 103 | func (s *SubIssueService) Add(ctx context.Context, owner, repo string, issueNumber int64, subIssue SubIssueRequest) (*SubIssue, *Response, error) { |
| 104 | u := fmt.Sprintf("repos/%v/%v/issues/%v/sub_issues", owner, repo, issueNumber) |
| 105 | req, err := s.client.NewRequest(ctx, "POST", u, subIssue) |
| 106 | if err != nil { |
| 107 | return nil, nil, err |
| 108 | } |
| 109 | |
| 110 | var si *SubIssue |
| 111 | resp, err := s.client.Do(req, &si) |
| 112 | if err != nil { |
| 113 | return nil, resp, err |
| 114 | } |
| 115 | |
| 116 | return si, resp, nil |
| 117 | } |
| 118 | |
| 119 | // Reprioritize changes a sub-issue's priority to a different position in the parent list. |
| 120 | // |