Assign Issue to Copilot via REST API #164267
Replies: 15 comments 17 replies
-
|
Some additional findings: https://cli.github.com/manual/gh_issue_edit seems to suggest that it is achievable through
I was able to get this working through the Power Automate connector's GitHub Graph QL action though (same as through Github GraphQL explorer), so it doesn't appear to be a case of auth mechanism of the OAuth based connector. |
Beta Was this translation helpful? Give feedback.
-
|
It seems like you can use GraphQL to do it. Note that the GraphQL example has a mistake: it is using Seems a little convoluted to have to create the issue, then do 3 separate GraphQL queries, but it is what it is :( |
Beta Was this translation helpful? Give feedback.
-
|
Yes @dosaki that's how I got it working. Not ideal, but it seems to work well enough, at least. |
Beta Was this translation helpful? Give feedback.
-
|
@dblyth-msft or @dosaki have you gotten this to work through graphql? Whenever I assign copilot directly when creating an issue it assigns but it doesn't spin up an agent session. If i try add it to an issue that has already been created I get |
Beta Was this translation helpful? Give feedback.
-
|
is it supported to use github App with related permission to assign issues to copilot? i cant find the offical docs. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks answers of @dblyth-msft @denishartl , but my Copilot assignment code always failed silently with Classic |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
I'm facing the same issue, not being able to assign an Issue to Copilot through the REST API. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
I wasn't able as well to programmatically assign copilot to a given issue using rest api despite token with right permission! |
Beta Was this translation helpful? Give feedback.
-
|
According to the Asking GitHub Copilot to create a pull request Github doc, the following permissions are required when using a Fine-grained PAT:
|
Beta Was this translation helpful? Give feedback.
-
|
So far I've been trying to assign to users "copilot" and "copilot-swe-agent". After reading another reported issue, I've realized that copilot user used there was "copilot-swe-agent[bot]". Using the username "copilot-swe-agent[bot]" with the python script I've provided before, works fine! Mistery solved, thanks! |
Beta Was this translation helpful? Give feedback.
-
|
In case it helps someone else, this is my experience:
Since I dont want to use my own PAT I had to give up, and is now experimenting with a GH Workflow using the Claude Github Action (https://github.com/anthropics/claude-code-action) |
Beta Was this translation helpful? Give feedback.
-
|
With a PAT with the following rights and this command it works : Maybe it is not the minimal permissions |
Beta Was this translation helpful? Give feedback.
-
|
1. The Exact Assignee Handle 2. Authentication Type (Use a PAT) 3. Required Token Permissions
Example REST API Payload: {
"assignees": ["copilot-swe-agent[bot]"]
}Applying these three steps should instantly resolve the HTTP 422 errors and successfully trigger the Copilot agent via REST! Huge thanks to everyone in the thread who pieced these details together. |
Beta Was this translation helpful? Give feedback.
-
|
It seems that this is currently no longer working. When triggering the agent via the Rest API, i getting following error:
Agent is assigned, but failed to startup, anyone having the same issue? |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
General
Copilot Feature Area
Copilot Coding Agent
Body
I was successfully able to assign an issue to Copilot through graphql (although the syntax here is not accurate according to the GH GraphQL explorer).
So, I know it works for my repo (verified through the UX, and through GraphQL), but I am struggling to get it work with the REST APIs. I have tried permutations along the lines of:
assignees: ["Copilot"]
assignees: ["copilot-swe-agent"]
assignees: ["BOT_..."]
But alas, I always get back an HTTP 422 with invalid assignees.
In full transparency, I am also trying to get this to work with the REST API through the Power Platform Connector, but I have been unable to get it to work through
gh apias well.Beta Was this translation helpful? Give feedback.
All reactions