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

Function UpdateIssueIssueType

api/queries_issue.go:507–535  ·  view source on GitHub ↗

UpdateIssueIssueType sets or clears the issue type on an issue. Pass an empty issueTypeID to clear the issue type.

(client *Client, hostname string, issueID string, issueTypeID string)

Source from the content-addressed store, hash-verified

505// UpdateIssueIssueType sets or clears the issue type on an issue. Pass an
506// empty issueTypeID to clear the issue type.
507func UpdateIssueIssueType(client *Client, hostname string, issueID string, issueTypeID string) error {
508 type UpdateIssueIssueTypeInput struct {
509 IssueID githubv4.ID `json:"issueId"`
510 IssueTypeID *githubv4.ID `json:"issueTypeId"`
511 }
512
513 var mutation struct {
514 UpdateIssueIssueType struct {
515 Issue struct {
516 ID string
517 }
518 } `graphql:"updateIssueIssueType(input: $input)"`
519 }
520
521 var typeID *githubv4.ID
522 if issueTypeID != "" {
523 id := githubv4.ID(issueTypeID)
524 typeID = &id
525 }
526
527 variables := map[string]any{
528 "input": UpdateIssueIssueTypeInput{
529 IssueID: githubv4.ID(issueID),
530 IssueTypeID: typeID,
531 },
532 }
533
534 return client.Mutate(hostname, "UpdateIssueIssueType", &mutation, variables)
535}
536
537// AddSubIssue adds a sub-issue to a parent issue.
538func AddSubIssue(client *Client, hostname string, parentID string, subIssueID string, replaceParent bool) error {

Callers 1

DeferredUpdateIssueFunction · 0.85

Calls 2

IDMethod · 0.65
MutateMethod · 0.65

Tested by

no test coverage detected