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

Function replaceIssueFields

pkg/cmd/pr/shared/editable_http.go:94–140  ·  view source on GitHub ↗
(httpClient *http.Client, repo ghrepo.Interface, id string, isPR bool, options Editable)

Source from the content-addressed store, hash-verified

92}
93
94func replaceIssueFields(httpClient *http.Client, repo ghrepo.Interface, id string, isPR bool, options Editable) error {
95 apiClient := api.NewClientFromHTTP(httpClient)
96
97 projectIds, err := options.ProjectIds()
98 if err != nil {
99 return err
100 }
101
102 var assigneeIds *[]string
103 // TODO ApiActorsSupported
104 if !options.ApiActorsSupported {
105 assigneeIds, err = options.AssigneeIds(apiClient, repo)
106 if err != nil {
107 return err
108 }
109 }
110
111 milestoneId, err := options.MilestoneId()
112 if err != nil {
113 return err
114 }
115
116 if isPR {
117 params := githubv4.UpdatePullRequestInput{
118 PullRequestID: id,
119 Title: ghString(options.TitleValue()),
120 Body: ghString(options.BodyValue()),
121 AssigneeIDs: ghIds(assigneeIds),
122 ProjectIDs: ghIds(projectIds),
123 MilestoneID: ghId(milestoneId),
124 }
125 if options.Base.Edited {
126 params.BaseRefName = ghString(&options.Base.Value)
127 }
128 return updatePullRequest(httpClient, repo, params)
129 }
130
131 params := githubv4.UpdateIssueInput{
132 ID: id,
133 Title: ghString(options.TitleValue()),
134 Body: ghString(options.BodyValue()),
135 AssigneeIDs: ghIds(assigneeIds),
136 ProjectIDs: ghIds(projectIds),
137 MilestoneID: ghId(milestoneId),
138 }
139 return updateIssue(httpClient, repo, params)
140}
141
142func dirtyExcludingLabels(e Editable) bool {
143 return e.Title.Edited ||

Callers 1

UpdateIssueFunction · 0.85

Calls 11

NewClientFromHTTPFunction · 0.92
ghStringFunction · 0.85
ghIdsFunction · 0.85
ghIdFunction · 0.85
updateIssueFunction · 0.85
ProjectIdsMethod · 0.80
AssigneeIdsMethod · 0.80
MilestoneIdMethod · 0.80
TitleValueMethod · 0.80
BodyValueMethod · 0.80
updatePullRequestFunction · 0.70

Tested by

no test coverage detected