MCPcopy Index your code
hub / github.com/cli/cli / AddSubIssue

Function AddSubIssue

api/queries_issue.go:517–541  ·  view source on GitHub ↗

AddSubIssue adds a sub-issue to a parent issue.

(client *Client, hostname string, parentID string, subIssueID string, replaceParent bool)

Source from the content-addressed store, hash-verified

515
516// AddSubIssue adds a sub-issue to a parent issue.
517func AddSubIssue(client *Client, hostname string, parentID string, subIssueID string, replaceParent bool) error {
518 type AddSubIssueInput struct {
519 IssueID githubv4.ID `json:"issueId"`
520 SubIssueID githubv4.ID `json:"subIssueId"`
521 ReplaceParent githubv4.Boolean `json:"replaceParent"`
522 }
523
524 var mutation struct {
525 AddSubIssue struct {
526 Issue struct {
527 ID string
528 }
529 } `graphql:"addSubIssue(input: $input)"`
530 }
531
532 variables := map[string]interface{}{
533 "input": AddSubIssueInput{
534 IssueID: githubv4.ID(parentID),
535 SubIssueID: githubv4.ID(subIssueID),
536 ReplaceParent: githubv4.Boolean(replaceParent),
537 },
538 }
539
540 return client.Mutate(hostname, "AddSubIssue", &mutation, variables)
541}
542
543// RemoveSubIssue removes a sub-issue from a parent issue.
544func RemoveSubIssue(client *Client, hostname string, parentID string, subIssueID string) error {

Callers 1

DeferredUpdateIssueFunction · 0.85

Calls 2

IDMethod · 0.65
MutateMethod · 0.65

Tested by

no test coverage detected