@@ -21,11 +21,12 @@ import { OpenOnGitHubQuickInputButton } from '../../commands/quickCommand.button
2121import { getSteps } from '../../commands/quickWizard.utils' ;
2222import { proBadge } from '../../constants' ;
2323import type { IntegrationId } from '../../constants.integrations' ;
24- import { HostingIntegrationId } from '../../constants.integrations' ;
24+ import { HostingIntegrationId , IssueIntegrationId } from '../../constants.integrations' ;
2525import type { Source , Sources , StartWorkTelemetryContext } from '../../constants.telemetry' ;
2626import type { Container } from '../../container' ;
27- import type { SearchedIssue } from '../../git/models/issue' ;
27+ import type { Issue , IssueShape , SearchedIssue } from '../../git/models/issue' ;
2828import { getOrOpenIssueRepository } from '../../git/models/issue' ;
29+ import type { Repository } from '../../git/models/repository' ;
2930import type { QuickPickItemOfT } from '../../quickpicks/items/common' ;
3031import { createQuickPickItemOfT } from '../../quickpicks/items/common' ;
3132import type { DirectiveQuickPickItem } from '../../quickpicks/items/directive' ;
@@ -67,7 +68,7 @@ export interface StartWorkCommandArgs {
6768 source ?: Sources ;
6869}
6970
70- export const supportedStartWorkIntegrations = [ HostingIntegrationId . GitHub ] ;
71+ export const supportedStartWorkIntegrations = [ HostingIntegrationId . GitHub , IssueIntegrationId . Jira ] ;
7172const instanceCounter = getScopedCounter ( ) ;
7273
7374export class StartWorkCommand extends QuickCommand < State > {
@@ -147,7 +148,7 @@ export class StartWorkCommand extends QuickCommand<State> {
147148 }
148149
149150 const issue = state . item ?. item ?. issue ;
150- const repo = issue && ( await getOrOpenIssueRepository ( this . container , issue ) ) ;
151+ const repo = issue && ( await this . getIssueRepositoryIfExists ( issue ) ) ;
151152
152153 if ( typeof state . action === 'string' ) {
153154 switch ( state . action ) {
@@ -159,7 +160,9 @@ export class StartWorkCommand extends QuickCommand<State> {
159160 state : {
160161 subcommand : 'create' ,
161162 repo : repo ,
162- name : issue ? slug ( `${ issue . id } -${ issue . title } ` ) : undefined ,
163+ name : issue
164+ ? `${ slug ( issue . id , { lower : false } ) } -${ slug ( issue . title ) } `
165+ : undefined ,
163166 suggestNameOnly : true ,
164167 suggestRepoOnly : true ,
165168 flags : state . inWorktree ? [ '--worktree' ] : [ '--switch' ] ,
@@ -201,6 +204,14 @@ export class StartWorkCommand extends QuickCommand<State> {
201204 return canPickStepContinue ( step , state , selection ) ? selection [ 0 ] . item : StepResultBreak ;
202205 }
203206
207+ private async getIssueRepositoryIfExists ( issue : IssueShape | Issue ) : Promise < Repository | undefined > {
208+ try {
209+ return await getOrOpenIssueRepository ( this . container , issue ) ;
210+ } catch {
211+ return undefined ;
212+ }
213+ }
214+
204215 private async * confirmLocalIntegrationConnectStep (
205216 state : StepState < State > ,
206217 context : Context ,
@@ -439,7 +450,7 @@ export class StartWorkCommand extends QuickCommand<State> {
439450async function updateContextItems ( container : Container , context : Context ) {
440451 context . result = {
441452 items :
442- ( await container . integrations . getMyIssues ( [ HostingIntegrationId . GitHub ] ) ) ?. map ( i => ( {
453+ ( await container . integrations . getMyIssues ( supportedStartWorkIntegrations ) ) ?. map ( i => ( {
443454 item : i ,
444455 } ) ) ?? [ ] ,
445456 } ;
0 commit comments