Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New custom field not accessible #151

Open
3 of 5 tasks
bobinrinder opened this issue Nov 5, 2023 · 1 comment
Open
3 of 5 tasks

New custom field not accessible #151

bobinrinder opened this issue Nov 5, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bobinrinder
Copy link

bobinrinder commented Nov 5, 2023

Please avoid duplicates

Reproducible test case

No response

Please select the environment(s) that are relevant to your bug report

  • Browsers
  • Node
  • Deno

Versions

NodeJs: v18.18.2
github-project: 5.4.0

What happened?

I have a weird issue: Some of the newly created custom fields cannot be found. I created different fields with different types but nothing works. Interestingly old custom fields that I created a while back work fine.

const options = {
  owner: "xxx",
  number: 2,
  token: "xxx",
  fields: {
    priority: "Priority",
    milestone: "Milestone",
    Estimate: { name: "Estimate", optional: true },
    lastUpdate: { name: "Last Update", optional: true },
  },
};
const project = new GitHubProject(options);
const data = await project.items.list();
console.log(data[0]);

results in getting the right object, but the Estimate custom field is missing.

Running this:

const data = await octokit.graphql(`
query {
  node(id: "PVT_kwDOAYW1RM4AAzYZ") {
    ... on ProjectV2 {
      items(first: 20) {
        nodes {
          id
          fieldValues(first: 20) {
            nodes {
              ... on ProjectV2ItemFieldNumberValue {
                field {
                  ... on ProjectV2Field {
                    name
                  }
                }
                number
                id
                updatedAt
                creator {
                  url
                }
              }
            }
          }
        }
      }
    }
  }
}
`);

console.log(data.node.items.nodes[0].fieldValues.nodes);

results in

[
  {},
  {},
  {},
  {},
  {},
  {},
  {},
  {},
  {
    field: { name: 'Estimate' },
    number: 15,
    id: 'PVTFNV_lQDOAYW1RM4AAzYczgJ_92DOB0nF8A',
    updatedAt: '2023-11-05T00:20:25Z',
    creator: { url: 'https://github.com/bobinrinder' }
  },
  {}
]

So looks like the name is set correctly. Any ideas? 🧐

Would you be interested in contributing a fix?

  • yes
@bobinrinder bobinrinder added the bug Something isn't working label Nov 5, 2023
@gr2m
Copy link
Owner

gr2m commented Nov 5, 2023

Hmm not out of hand, I'd have to investigate myself. I have not seen this happening before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants