@@ -7,6 +7,7 @@ import { basename } from 'path';
77import * as vscode from 'vscode' ;
88import { Remote } from '../api/api' ;
99import { GitApiImpl } from '../api/api1' ;
10+ import { COPILOT_ACCOUNTS } from '../common/comment' ;
1011import { commands } from '../common/executeCommands' ;
1112import { Disposable } from '../common/lifecycle' ;
1213import Logger from '../common/logger' ;
@@ -1264,6 +1265,9 @@ ${options?.body ?? ''}\n
12641265 folderManager = await this . chooseRepo ( vscode . l10n . t ( 'Choose where to create the issue.' ) ) ;
12651266 }
12661267
1268+ const assigneesWithoutCopilot = assignees ?. filter ( assignee => ! COPILOT_ACCOUNTS [ assignee ] ) ;
1269+ const copilotAssignee = ! ! assignees ?. find ( assignee => COPILOT_ACCOUNTS [ assignee ] ) ;
1270+
12671271 return vscode . window . withProgress ( { location : vscode . ProgressLocation . Notification , title : vscode . l10n . t ( 'Creating issue' ) } , async ( progress ) => {
12681272 if ( ! folderManager ) {
12691273 return false ;
@@ -1287,7 +1291,7 @@ ${options?.body ?? ''}\n
12871291 repo : origin . repo ,
12881292 title,
12891293 body,
1290- assignees,
1294+ assignees : assigneesWithoutCopilot ,
12911295 labels,
12921296 milestone
12931297 } ;
@@ -1298,6 +1302,12 @@ ${options?.body ?? ''}\n
12981302 progress . report ( { message : vscode . l10n . t ( 'Creating issue in {0}...' , `${ createParams . owner } /${ createParams . repo } ` ) } ) ;
12991303 const issue = await folderManager . createIssue ( createParams ) ;
13001304 if ( issue ) {
1305+ if ( copilotAssignee ) {
1306+ const copilotUser = ( await folderManager . getAssignableUsers ( ) ) [ issue . remote . remoteName ] . find ( user => COPILOT_ACCOUNTS [ user . login ] ) ;
1307+ if ( copilotUser ) {
1308+ await issue . replaceAssignees ( [ ...( issue . assignees ?? [ ] ) , copilotUser ] ) ;
1309+ }
1310+ }
13011311 if ( projects ) {
13021312 await issue . updateProjects ( projects ) ;
13031313 }
0 commit comments