9.9 KiB
title, intro, product, versions, topics, type, redirect_from
| title | intro | product | versions | topics | type | redirect_from | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Using Copilot to work on an issue | Learn how to assign issues to {% data variables.product.prodname_copilot %}, monitor progress as {% data variables.product.prodname_copilot_short %} works on the issue, and then use pull request review comments to prompt {% data variables.product.prodname_copilot_short %} to iterate on its work. | {% data reusables.gated-features.copilot-coding-agent %}<br><a href="https://github.com/features/copilot/plans?ref_cta=Copilot+plans+signup&ref_loc=using+copilot+to+work+on+an+issue&ref_page=docs" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Sign up for {% data variables.product.prodname_copilot_short %}</span> {% octicon "link-external" height:16 %}</a> |
|
|
how_to |
|
{% data reusables.copilot.coding-agent.preview-note %}
Introduction
You can assign a {% data variables.product.github %} issue to {% data variables.product.prodname_copilot_short %}, just like you would with a human software developer. {% data variables.product.prodname_copilot_short %} will start working on the issue, raise a pull request and when it's finished working, request a review from you. For more information, see AUTOTITLE.
If you haven't used {% data variables.product.prodname_copilot_short %} to work on an issue before, you can find some useful advice for getting good results in AUTOTITLE.
Assigning an issue to {% data variables.product.prodname_copilot_short %}
You can ask {% data variables.product.prodname_copilot_short %} to start working on an issue by assigning the issue to {% data variables.product.prodname_copilot_short %}.
You can assign an issue to {% data variables.product.prodname_copilot_short %}:
- On {% data variables.product.prodname_dotcom_the_website %} (see the next section)
- Via the {% data variables.product.github %} API (see later in this article)
- From the beta version of {% data variables.product.prodname_mobile %} (Join iOS TestFlight or Join Google Play Beta)
- Using {% data variables.product.prodname_cli %} (see
gh issue edit)
Assigning an issue to {% data variables.product.prodname_copilot_short %} on {% data variables.product.prodname_dotcom_the_website %}
You can assign an issue to {% data variables.product.prodname_copilot_short %} on {% data variables.product.prodname_dotcom_the_website %} in exactly the same way as you assign another user.
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-issues %}
-
Open the issue that you want to assign to {% data variables.product.prodname_copilot_short %}.
-
In the right side menu, click Assignees.
-
Click Copilot from assignees list.
Tip
When you assign an issue to {% data variables.product.prodname_copilot_short %}, it gets sent the issue title, description, and any comments that currently exist. After assigning the issue, {% data variables.product.prodname_copilot_short %} will not be aware of, and therefore won't react to, any further comments that are added to the issue. If you have more information, or changes to the original requirement, add this as a comment in the pull request that {% data variables.product.prodname_copilot_short %} raises.
You can also assign issues to {% data variables.product.prodname_copilot_short %} from other places on {% data variables.product.prodname_dotcom_the_website %}:
- From the list of issues on a repository's {% octicon "issue-opened" aria-hidden="true" aria-label="issue-opened" %} Issues page.
- When viewing an issue in {% data variables.product.github %} {% data variables.projects.projects_v2_caps %}.
Assigning an issue to {% data variables.product.prodname_copilot_short %} via the {% data variables.product.github %} API
You can assign an issue to {% data variables.product.prodname_copilot_short %} by making a request to the GraphQL API.
-
Make sure you're authenticating with the API using a user token, for example a {% data variables.product.pat_generic %} or a {% data variables.product.prodname_github_app %} user-to-server token.
-
Verify that {% data variables.copilot.copilot_coding_agent %} is enabled in the repository by checking if the repository's
suggestedActorsin the GraphQL API includes {% data variables.product.prodname_copilot_short %}. Replacemonalisawith the repository owner, andoctocatwith the name.query { repository(owner: "monalisa", name: "octocat") { suggestedActors(capabilities: [CAN_BE_ASSIGNED], first: 100) { nodes { login __typename ... on Bot { id } ... on User { id } } } } }If {% data variables.copilot.copilot_coding_agent %} is enabled for the user and in the repository, the first node returned from the query will have the
loginvaluecopilot-swe-agent. -
Fetch the GraphQL global ID of the issue you want to assign to {% data variables.product.prodname_copilot_short %}, replacing
monalisawith the repository owner,octocatwith the name and9000with the issue number.query { repository(owner: "monalisa", name: "octocat") { issue(number: 9000) { id title } } } -
Assign the issue to {% data variables.product.prodname_copilot_short %} using the
replaceActorsForAssignableGraphQL mutation. ReplaceISSUE_IDwith the ID returned from the previous step, andBOT_IDwith the ID returned from the step before that.mutation { replaceActorsForAssignable(input: {assignableId: "ISSUE_ID", assigneeIds: ["BOT_ID"]}) { assignable { ... on Issue { id title assignees(first: 10) { nodes { login } } } } } }
Tracking {% data variables.product.prodname_copilot_short %}'s progress on your issue
Shortly after you assign an issue to {% data variables.product.prodname_copilot_short %}, {% data variables.product.prodname_copilot_short %} will leave an 👀 reaction on the issue.
A few seconds later, {% data variables.product.prodname_copilot_short %} will open a draft pull request, linked to your original issue. An event will appear in the issue's timeline, linking to the pull request.
{% data variables.product.prodname_copilot_short %} will start an agent session to work on your issue. A "{% data variables.product.prodname_copilot_short %} started work" event will appear in the pull request timeline, and as {% data variables.product.prodname_copilot_short %} works, it will update the pull request body with regular status updates, and push commits to the branch.
If you want to check what {% data variables.product.prodname_copilot_short %} is doing, click View session. The session log viewer is displayed, showing you a live log as {% data variables.product.prodname_copilot_short %} works on the issue. If you want to stop {% data variables.product.prodname_copilot_short %} from working on the issue, click Stop session. See AUTOTITLE.
Once {% data variables.product.prodname_copilot_short %} has finished, the agent session will end, and {% data variables.product.prodname_copilot_short %} will request a review from you, triggering a notification. In addition, a "{% data variables.product.prodname_copilot_short %} finished work" event will appear in the pull request timeline.
Working with {% data variables.product.prodname_copilot_short %} on a pull request
After {% data variables.product.prodname_copilot_short %} has finished working on the issue, you should review the pull request thoroughly and comment on anything that needs changed. See AUTOTITLE.





