Put an issue on a project board with add_item_to_project
Goal: add an issue to a Projects v2 board, without creating a duplicate item if it’s already there.
Prerequisites
Section titled “Prerequisites”- A classic OAuth-scoped GitHub token (
ghp_/gho_) needs theprojectscope (gh auth login --scopes project). GitHub App installation tokens and fine-grained PATs skip this pre-check and rely on the API call itself to fail if access is genuinely missing. - You know the project’s owner login, number, and owner type
(
organizationoruser). - The issue already exists.
-
Call
add_item_to_project:{"owner": "your-org","repo": "your-repo","issueNumber": 101,"projectOwnerLogin": "your-org","projectNumber": 1}Omit
projectOwnerTypefor an organization-owned project; pass"projectOwnerType": "user"for a user-owned one. -
Read the response:
{ itemId, existed }.
Verify it worked
Section titled “Verify it worked”- If
existed: false, this call created a new item — reload the project board and confirm the issue appears. - If
existed: true, the issue already had an item on this project (for example, a nativeAuto-add to projectworkflow added it the moment the issue was created) and the tool returned that item’s ID instead of creating a second one. This is the documented behavior from ADR-0003 — before this plugin’s own tools call anything, check whether the board already has native automation covering this, since a duplicateaddProjectV2ItemByIdcall has no idempotency key on GitHub’s side. - A missing
projectscope surfaces as{ error: "missing_scope", missingScope: "project", presentScopes: [...] }before any mutation is attempted.
See also: tool reference.