@@ -786,6 +786,8 @@ export class IssueFeatureRegistrar extends Disposable {
786786 ...options ,
787787 title : template . title ,
788788 body : template . body ,
789+ labels : template . labels ,
790+ assignees : template . assignees ,
789791 } ;
790792 }
791793 this . makeNewIssueFile ( uri , options ) ;
@@ -1136,7 +1138,7 @@ export class IssueFeatureRegistrar extends Disposable {
11361138 await vscode . workspace . fs . delete ( bodyPath ) ;
11371139 const assigneeLine = `${ ASSIGNEES } ${ options ?. assignees && options . assignees . length > 0 ? options . assignees . map ( value => '@' + value ) . join ( ', ' ) + ' ' : ''
11381140 } `;
1139- const labelLine = `${ LABELS } ` ;
1141+ const labelLine = `${ LABELS } ${ options ?. labels && options . labels . length > 0 ? options . labels . join ( ', ' ) + ' ' : '' } ` ;
11401142 const milestoneLine = `${ MILESTONE } ` ;
11411143 const projectsLine = `${ PROJECTS } ` ;
11421144 const cached = this . _newIssueCache . get ( ) ;
@@ -1283,14 +1285,14 @@ ${options?.body ?? ''}\n
12831285 return choice ?. repo ;
12841286 }
12851287
1286- private async chooseTemplate ( folderManager : FolderRepositoryManager ) : Promise < { title : string | undefined , body : string | undefined } | undefined > {
1288+ private async chooseTemplate ( folderManager : FolderRepositoryManager ) : Promise < IssueTemplate | undefined > {
12871289 const templateUris = await folderManager . getIssueTemplates ( ) ;
12881290 if ( templateUris . length === 0 ) {
1289- return { title : undefined , body : undefined } ;
1291+ return { title : undefined , body : undefined , labels : undefined , assignees : undefined , name : undefined , about : undefined } ;
12901292 }
12911293
12921294 interface IssueChoice extends vscode . QuickPickItem {
1293- template : { title : string | undefined , body : string | undefined } | undefined ;
1295+ template : IssueTemplate | undefined ;
12941296 }
12951297 const templates = await Promise . all (
12961298 templateUris
@@ -1316,7 +1318,7 @@ ${options?.body ?? ''}\n
13161318 } ) ;
13171319 choices . push ( {
13181320 label : vscode . l10n . t ( 'Blank issue' ) ,
1319- template : { title : undefined , body : undefined }
1321+ template : { title : undefined , body : undefined , labels : undefined , assignees : undefined , name : undefined , about : undefined }
13201322 } ) ;
13211323
13221324 const selectedTemplate = await vscode . window . showQuickPick ( choices , {
@@ -1343,15 +1345,23 @@ ${options?.body ?? ''}\n
13431345 const title = template . match ( / t i t l e : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
13441346 const name = template . match ( / n a m e : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
13451347 const about = template . match ( / a b o u t : \s * ( .* ) / ) ?. [ 1 ] ?. replace ( / ^ [ " ' ] | [ " ' ] $ / g, '' ) ;
1348+ const labelsMatch = template . match ( / l a b e l s : \s * ( .* ) / ) ?. [ 1 ] ;
1349+ const labels = labelsMatch ? labelsMatch . split ( ',' ) . map ( label => label . trim ( ) ) . filter ( label => label ) : undefined ;
1350+ const assigneesMatch = template . match ( / a s s i g n e e s : \s * ( .* ) / ) ?. [ 1 ] ;
1351+ const assignees = assigneesMatch ? assigneesMatch . split ( ',' ) . map ( assignee => assignee . trim ( ) ) . filter ( assignee => assignee ) : undefined ;
13461352 const body = template . match ( / - - - ( [ \s \S ] * ) - - - ( [ \s \S ] * ) / ) ?. [ 2 ] ;
1347- return { title, name, about, body } ;
1353+ return { title, name, about, labels , assignees , body } ;
13481354 }
13491355
13501356 private parseYamlTemplate ( parsed : YamlIssueTemplate ) : IssueTemplate {
13511357 const name = parsed . name ;
13521358 const about = parsed . description || parsed . about ;
13531359 const title = parsed . title ;
13541360
1361+ // Extract labels and assignees from YAML
1362+ const labels = parsed . labels && Array . isArray ( parsed . labels ) ? parsed . labels : undefined ;
1363+ const assignees = parsed . assignees && Array . isArray ( parsed . assignees ) ? parsed . assignees : undefined ;
1364+
13551365 // Convert YAML body fields to markdown
13561366 let body = '' ;
13571367 if ( parsed . body && Array . isArray ( parsed . body ) ) {
@@ -1396,7 +1406,7 @@ ${options?.body ?? ''}\n
13961406 }
13971407 }
13981408
1399- return { title, name, about, body : body . trim ( ) || undefined } ;
1409+ return { title, name, about, labels , assignees , body : body . trim ( ) || undefined } ;
14001410 }
14011411
14021412 private async doCreateIssue (
0 commit comments