Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CLI reports error when issuing pr edit trying to add the PR to a projectΒ #11986

@coltfred

Description

@coltfred

Describe the bug

Running

gh pr edit "https://github.com/IronCoreLabs/ironnode/pull/121" --add-project "🍻 The Big Board 🌯"

Results in:

error fetching organization projects (classic): GraphQL: Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. (organization.projects)

I've attached logs. The CLI seems to be issuing:

query OrganizationProjectV2List($endCursor:String$owner:String!$query:String!){organization(login: $owner){projectsV2(first: 100, orderBy: {field: TITLE, direction: ASC}, after: $endCursor, query: $query){nodes{id,title,number,resourcePath,closed,url},pageInfo{hasNextPage,endCursor}}}} GraphQL variables: {"endCursor":null,"owner":"IronCoreLabs","query":"is:open"}

If I do that using the graphql API it returns the project I'd expect. If you look at gh-output.txt it doesn't seem to work correctly. Here's the output from my local run of the same graphql query.

{
  "data": {
    "organization": {
      "projectsV2": {
        "nodes": [
...
          {
            "id": "PVT_kwDOAK3b_84AxEPf",
            "title": "🍻 The Big Board 🌯",
            "number": 8,
            "resourcePath": "/orgs/IronCoreLabs/projects/8",
            "closed": false,
            "url": "https://github.com/orgs/IronCoreLabs/projects/8"
          }
...
        ],
...
}

Based on this it seems like it's trying to use the v2 apis, failing to do so and falling back to the v1 (classic) apis and then reporting that I asked it to do something with a classic project.

Let me know if there's any more data you'd like.

Affected version

I've tested it on both:

gh version 2.76.0 (nixpkgs)
https://github.com/cli/cli/releases/tag/v2.76.0

and

gh version 2.82.0 (2025-10-15)
https://github.com/cli/cli/releases/tag/v2.82.0

Steps to reproduce the behavior

  1. Issue a PR edit to add something to a project, see that it errors.

Expected vs actual behavior

A clear and concise description of what you expected to happen and what actually happened.

Logs

gh-output.txt

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggh-prrelating to the gh pr commandp2Affects more than a few users but doesn't prevent core functions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions