MCPcopy
hub / github.com/cli/cli / ProjectIds

Method ProjectIds

pkg/cmd/pr/shared/editable.go:216–229  ·  view source on GitHub ↗

ProjectIds returns a slice containing IDs of projects v1 that the issue or a PR has to be linked to.

()

Source from the content-addressed store, hash-verified

214
215// ProjectIds returns a slice containing IDs of projects v1 that the issue or a PR has to be linked to.
216func (e Editable) ProjectIds() (*[]string, error) {
217 if !e.Projects.Edited {
218 return nil, nil
219 }
220 if len(e.Projects.Add) != 0 || len(e.Projects.Remove) != 0 {
221 s := set.NewStringSet()
222 s.AddValues(e.Projects.Default)
223 s.AddValues(e.Projects.Add)
224 s.RemoveValues(e.Projects.Remove)
225 e.Projects.Value = s.ToSlice()
226 }
227 p, _, err := e.Metadata.ProjectsTitlesToIDs(e.Projects.Value)
228 return &p, err
229}
230
231// ProjectV2Ids returns a pair of slices.
232// The first is the projects the item should be added to.

Callers 1

replaceIssueFieldsFunction · 0.80

Calls 5

NewStringSetFunction · 0.92
AddValuesMethod · 0.80
RemoveValuesMethod · 0.80
ProjectsTitlesToIDsMethod · 0.80
ToSliceMethod · 0.65

Tested by

no test coverage detected