@@ -239,6 +239,46 @@ func (s *ProjectsService) ListProjectFieldsForUser(ctx context.Context, user str
239239 return fields , resp , nil
240240}
241241
242+ // GetProjectFieldForOrg gets a single project field from an organization owned project.
243+ //
244+ // GitHub API docs: https://docs.github.com/en/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-organization
245+ //
246+ //meta:operation GET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}
247+ func (s * ProjectsService ) GetProjectFieldForOrg (ctx context.Context , org string , projectNumber , fieldID int64 ) (* ProjectV2Field , * Response , error ) {
248+ u := fmt .Sprintf ("orgs/%v/projectsV2/%v/fields/%v" , org , projectNumber , fieldID )
249+ req , err := s .client .NewRequest ("GET" , u , nil )
250+ if err != nil {
251+ return nil , nil , err
252+ }
253+
254+ field := new (ProjectV2Field )
255+ resp , err := s .client .Do (ctx , req , field )
256+ if err != nil {
257+ return nil , resp , err
258+ }
259+ return field , resp , nil
260+ }
261+
262+ // GetProjectFieldForUser gets a single project field from a user owned project.
263+ //
264+ // GitHub API docs: https://docs.github.com/en/rest/projects/fields?apiVersion=2022-11-28#get-project-field-for-user
265+ //
266+ //meta:operation GET /users/{username}/projectsV2/{project_number}/fields/{field_id}
267+ func (s * ProjectsService ) GetProjectFieldForUser (ctx context.Context , user string , projectNumber , fieldID int64 ) (* ProjectV2Field , * Response , error ) {
268+ u := fmt .Sprintf ("users/%v/projectsV2/%v/fields/%v" , user , projectNumber , fieldID )
269+ req , err := s .client .NewRequest ("GET" , u , nil )
270+ if err != nil {
271+ return nil , nil , err
272+ }
273+
274+ field := new (ProjectV2Field )
275+ resp , err := s .client .Do (ctx , req , field )
276+ if err != nil {
277+ return nil , resp , err
278+ }
279+ return field , resp , nil
280+ }
281+
242282// ListProjectItemsOptions specifies optional parameters when listing project items.
243283// Note: Pagination uses before/after cursor-style pagination similar to ListProjectsOptions.
244284// "Fields" can be used to restrict which field values are returned (by their numeric IDs).
0 commit comments