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

Method ProjectIds

pkg/cmd/pr/shared/editable.go:217–230  ·  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

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