Closed nashafa closed 1 year ago
I have the same problem.
I am able to get info using command line
gh api graphql -f query='
query{
node(id: "PVTI_xxxxxx") {
... on ProjectV2Item {
fieldValueByName(name: "Status") {
... on ProjectV2ItemFieldSingleSelectValue {
name
id
field {
... on ProjectV2FieldCommon {
name
}
}
}
}
}
}
}
'
but with the following go query
type ProjectItemDetailsQuery struct {
Node struct {
ID githubv4.ID
ProjectV2Item struct {
StatusField struct {
SingleSelectFieldValue struct {
ID string
Name string
OptionID string
} `graphql:"... on ProjectV2ItemFieldSingleSelectValue"`
} `graphql:"status: fieldValueByName(name: \"Status\")"`
} `graphql:"... on ProjectV2Item"`
} `graphql:"node(id: $id)"`
}
it is returning null values, except if I do it with a draft issue.
Any lead towards a solution?
Well we can close that. The problem was that you need to add permission to the app for accessing issues as well as projects.
Thanks for looking into this. That would actually make a lot of sense; I've run into similar problems with GitHub Projects elsewhere, but didn't think specifically to check that the permission for Issues was provided.
I'm no longer using this API, but I'll go ahead and close this assuming that is the correct fix.
Hi. I'm running into a problem where I am unable query titles, ids, etc. for items in projects that are issues. I have not tested with pull requests, but I am able to query info for draft issues.
For example, the following GraphQL query works fine in the GitHub GraphQL API Explorer and with
gh api
(filling in a valid ProjectV2Item's node_id).This is the equivalent I am using in Go.
Oddly, for draft issues, the title appears in
GitHubProjectItemQuery.Node.ProjectV2Item.Content.DraftIssue.Title
,GitHubProjectItemQuery.Node.ProjectV2Item.Content.Issue.Title
, andGitHubProjectItemQuery.Node.ProjectV2Item.Content.PullRequest.Title
. For issues, nothing appears for any title, id, etc.Any ideas as to what exactly is going on here? Thanks for the help.