AddSubIssue adds a sub-issue to a parent issue.
(client *Client, hostname string, parentID string, subIssueID string, replaceParent bool)
| 536 | |
| 537 | // AddSubIssue adds a sub-issue to a parent issue. |
| 538 | func AddSubIssue(client *Client, hostname string, parentID string, subIssueID string, replaceParent bool) error { |
| 539 | type AddSubIssueInput struct { |
| 540 | IssueID githubv4.ID `json:"issueId"` |
| 541 | SubIssueID githubv4.ID `json:"subIssueId"` |
| 542 | ReplaceParent githubv4.Boolean `json:"replaceParent"` |
| 543 | } |
| 544 | |
| 545 | var mutation struct { |
| 546 | AddSubIssue struct { |
| 547 | Issue struct { |
| 548 | ID string |
| 549 | } |
| 550 | } `graphql:"addSubIssue(input: $input)"` |
| 551 | } |
| 552 | |
| 553 | variables := map[string]any{ |
| 554 | "input": AddSubIssueInput{ |
| 555 | IssueID: githubv4.ID(parentID), |
| 556 | SubIssueID: githubv4.ID(subIssueID), |
| 557 | ReplaceParent: githubv4.Boolean(replaceParent), |
| 558 | }, |
| 559 | } |
| 560 | |
| 561 | return client.Mutate(hostname, "AddSubIssue", &mutation, variables) |
| 562 | } |
| 563 | |
| 564 | // RemoveSubIssue removes a sub-issue from a parent issue. |
| 565 | func RemoveSubIssue(client *Client, hostname string, parentID string, subIssueID string) error { |
no test coverage detected