GitHub GraphQL issue mutations accept agentAssignment
Introduced 2026-02-07 · score 0.92
HOW TO USE IT
When creating or assigning an issue to Copilot with a listed GraphQL mutation, include `agentAssignment` in its input to configure the assignment.
gh api graphql -f query='mutation { createIssue(input: { repositoryId: "<REPOSITORY_ID>", title: "<TITLE>", body: "<DETAILS>", assigneeIds: ["<BOT_ID>"], agentAssignment: { targetRepositoryId: "<REPOSITORY_ID>", baseRef: "<BRANCH>", customInstructions: "<INSTRUCTIONS>", customAgent: "<CUSTOM_AGENT>" } }) { issue { id title } } }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'gh api graphql -f query='mutation { addAssigneesToAssignable(input: { assignableId: "<ISSUE_ID>", assigneeIds: ["<BOT_ID>"], agentAssignment: { targetRepositoryId: "<REPOSITORY_ID>", baseRef: "<BRANCH>", customInstructions: "<INSTRUCTIONS>", customAgent: "<CUSTOM_AGENT>" } }) { assignable { ... on Issue { id title } } } }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'gh api graphql -f query='mutation { updateIssue(input: { id: "<ISSUE_ID>", assigneeIds: ["<BOT_ID>"], agentAssignment: { targetRepositoryId: "<REPOSITORY_ID>", baseRef: "<BRANCH>", customInstructions: "<INSTRUCTIONS>", customAgent: "<CUSTOM_AGENT>" } }) { issue { id title } } }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'WHY THIS HELPS
Create or update an issue, or change its assignees, with agent assignment details through the GitHub GraphQL API.
REQUIREMENTS AND LIMITATIONS
- Version: 2026-02-07
- agentAssignment: Optional configuration for assigning Copilot or an AI agent; accepted by the four mutation input objects named in the release note.
- baseRef: String branch reference. Example uses `main`.
- customAgent: String custom agent value; example uses an empty string.
- customInstructions: String instructions customizing the task.
- targetRepositoryId: ID of the target repository.
- Prerequisite: Include the `GraphQL-Features` header with `issues_copilot_assignment_api_support` and `coding_agent_model_selection`.
- Prerequisite: For Copilot assignment, authenticate with a user token and ensure Copilot cloud agent is enabled for the user and repository. The docs demonstrate checking `suggestedActors` for Copilot.
FIRST-PARTY EVIDENCE
- https://docs.github.com/en/graphql/overview/changelog#schema-changes-for-2026-02-07
- https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/cloud-agent/use-cloud-agent-via-the-api
- https://docs.github.com/en/graphql/reference/issues
Check the installed version and the source before using it. Entry JSON