MCPcopy Create free account
hub / github.com/cli/cli / AddSubIssue

Function AddSubIssue

api/queries_issue.go:538–562  ·  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

536
537// AddSubIssue adds a sub-issue to a parent issue.
538func 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.
565func 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