You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,6 +60,9 @@ You can assign an issue to {% data variables.product.prodname_copilot_short %}:
60
60
61
61
### Assigning an issue to {% data variables.product.prodname_copilot_short %} on {% data variables.product.prodname_dotcom_the_website %}
62
62
63
+
> [!NOTE]
64
+
> This feature is in {% data variables.release-phases.public_preview %} and subject to change.
65
+
63
66
{% data reusables.repositories.navigate-to-repo %}
64
67
{% data reusables.repositories.sidebar-issues %}
65
68
@@ -113,9 +116,32 @@ You can also assign issues to {% data variables.product.prodname_copilot_short %
113
116
114
117
### Assigning an issue to {% data variables.product.prodname_copilot_short %} via the {% data variables.product.github %} API
115
118
116
-
You can assign issues to {% data variables.product.prodname_copilot_short %} using the GraphQL API.
119
+
> [!NOTE]
120
+
> This feature is in {% data variables.release-phases.public_preview %} and subject to change.
121
+
122
+
You can assign issues to {% data variables.product.prodname_copilot_short %} using either the GraphQL API or the REST API. Both APIs support an optional Agent Assignment input to customize the task:
1. 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.
121
147
@@ -163,11 +189,23 @@ You can assign issues to {% data variables.product.prodname_copilot_short %} usi
163
189
}
164
190
```
165
191
166
-
1. Createtheissuewiththe `createIssue` mutation. Replace `REPOSITORY_ID` withtheIDreturnedfromthepreviousstep, and `BOT_ID` withtheIDreturnedfromthestepbeforethat.
* [Create an issue](/rest/issues/issues#create-an-issue)
357
+
* [Update an issue](/rest/issues/issues#update-an-issue)
358
+
359
+
##### Adding assignees to an existing issue
360
+
361
+
```shell copy
362
+
gh api \
363
+
--method POST \
364
+
-H "Accept: application/vnd.github+json" \
365
+
-H "X-GitHub-Api-Version: 2022-11-28" \
366
+
/repos/OWNER/REPO/issues/ISSUE_NUMBER/assignees \
367
+
--input - <<< '{
368
+
"assignees": ["copilot-swe-agent[bot]"],
369
+
"agent_assignment": {
370
+
"target_repo": "OWNER/REPO",
371
+
"base_branch": "main",
372
+
"custom_instructions": "",
373
+
"custom_agent": "",
374
+
"model": ""
375
+
}
376
+
}'
377
+
```
378
+
379
+
##### Creating a new issue
380
+
381
+
```shell copy
382
+
gh api \
383
+
--method POST \
384
+
-H "Accept: application/vnd.github+json" \
385
+
-H "X-GitHub-Api-Version: 2022-11-28" \
386
+
/repos/OWNER/REPO/issues \
387
+
--input - <<< '{
388
+
"title": "Issue title",
389
+
"body": "Issue description.",
390
+
"assignees": ["copilot-swe-agent[bot]"],
391
+
"agent_assignment": {
392
+
"target_repo": "OWNER/REPO",
393
+
"base_branch": "main",
394
+
"custom_instructions": "",
395
+
"custom_agent": "",
396
+
"model": ""
397
+
}
398
+
}'
399
+
```
400
+
401
+
##### Updating an existing issue
402
+
403
+
```shell copy
404
+
gh api \
405
+
--method PATCH \
406
+
-H "Accept: application/vnd.github+json" \
407
+
-H "X-GitHub-Api-Version: 2022-11-28" \
408
+
/repos/OWNER/REPO/issues/ISSUE_NUMBER \
409
+
--input - <<< '{
410
+
"assignees": ["copilot-swe-agent[bot]"],
411
+
"agent_assignment": {
412
+
"target_repo": "OWNER/REPO",
413
+
"base_branch": "main",
414
+
"custom_instructions": "",
415
+
"custom_agent": "",
416
+
"model": ""
417
+
}
418
+
}'
419
+
```
420
+
245
421
## Asking {% data variables.product.prodname_copilot_short %} to create a pull request from the agents tab or panel
246
422
247
423
You can ask {% data variables.product.prodname_copilot_short %} to open a pull request from either the agents tab or the agents panel. The only difference is the entry point - once you see the "New agent task" form, the steps are the same.
0 commit comments