Open bagermen opened 4 days ago
Branch issue-922-copyIssueProjectsToPR_does_not_work_for_Projects created!
Hi @bagermen
You are right, it broke for the "new" projects, thanks for the detailed issue!
So far, I'm able to query "classic" and "new" projects IDs:
query ($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
issue(number: $number) {
projectCards {
nodes {
project {
id
}
}
},
projectItems(first: 10) {
nodes {
project {
id
}
}
}
}
}
}
Unfortunately, I'm unable to use the IDs from the projectItems
part in the mutation for the pull-request. The following mutation gives the error message "Could not resolve to Project node with the global id of 'PVT_kwDOBL_hb84ApI2u'":
mutation ($pullRequestId: ID!, $projectIds: [ID!]) {
updatePullRequest(
input: {pullRequestId: $pullRequestId, projectIds: $projectIds}
) {
pullRequest {
id
}
}
}
I'm using the GitHub GraphQL explorer for testing.
One difference I noticed in the query is that for "new" projects, the node type is "Projectv2", where the error message mentions a "Project" node. But I'm not sure if that's causing the error.
It would be helpful if you could verify the above behavior on your own projects/PRs.
Kind regards, Rob
I guess copyIssueProjectsToPR works for Classic Projects but not for new Projects.
The query shows me my project:
This one return empty results
There should be at least a note for that in the documentation