@@ -176,19 +176,9 @@ export class StartWorkCommand extends QuickCommand<State> {
176
176
'startWork/issue/chosen' ,
177
177
{
178
178
...context . telemetryContext ! ,
179
+ ...buildItemTelemetryData ( result ) ,
179
180
connected : true ,
180
181
type : state . type ,
181
- 'item.id' : getStartWorkItemIdHash ( result ) ,
182
- 'item.type' : result . item . issue . type ,
183
- 'item.provider' : result . item . issue . provider . id ,
184
- 'item.assignees.count' : result . item . issue . assignees ?. length ?? undefined ,
185
- 'item.createdDate' : result . item . issue . createdDate . getTime ( ) ,
186
- 'item.updatedDate' : result . item . issue . updatedDate . getTime ( ) ,
187
-
188
- 'item.comments.count' : result . item . issue . commentsCount ?? undefined ,
189
- 'item.upvotes.count' : result . item . issue . thumbsUpCount ?? undefined ,
190
-
191
- 'item.issue.state' : result . item . issue . state ,
192
182
} ,
193
183
this . source ,
194
184
) ;
@@ -536,27 +526,13 @@ export class StartWorkCommand extends QuickCommand<State> {
536
526
state : StepState < State > ,
537
527
context : Context ,
538
528
) {
539
- this . container . telemetry . sendEvent (
540
- 'startWork/issue/action' ,
541
- {
542
- ...context . telemetryContext ! ,
543
- action : action ,
544
- connected : true ,
545
- type : state . type ,
546
- 'item.id' : getStartWorkItemIdHash ( item ) ,
547
- 'item.type' : item . item . issue . type ,
548
- 'item.provider' : item . item . issue . provider . id ,
549
- 'item.assignees.count' : item . item . issue . assignees ?. length ?? undefined ,
550
- 'item.createdDate' : item . item . issue . createdDate . getTime ( ) ,
551
- 'item.updatedDate' : item . item . issue . updatedDate . getTime ( ) ,
552
-
553
- 'item.comments.count' : item . item . issue . commentsCount ?? undefined ,
554
- 'item.upvotes.count' : item . item . issue . thumbsUpCount ?? undefined ,
555
-
556
- 'item.issue.state' : item . item . issue . state ,
557
- } ,
558
- this . source ,
559
- ) ;
529
+ this . container . telemetry . sendEvent ( 'startWork/issue/action' , {
530
+ ...context . telemetryContext ! ,
531
+ ...buildItemTelemetryData ( item ) ,
532
+ action : action ,
533
+ connected : true ,
534
+ type : state . type ,
535
+ } ) ;
560
536
}
561
537
562
538
private async getConnectedIntegrations ( ) : Promise < Map < SupportedStartWorkIntegrationIds , boolean > > {
@@ -615,6 +591,22 @@ export function getStartWorkItemIdHash(item: StartWorkItem) {
615
591
return md5 ( item . item . issue . id ) ;
616
592
}
617
593
594
+ function buildItemTelemetryData ( item : StartWorkItem ) {
595
+ return {
596
+ 'item.id' : getStartWorkItemIdHash ( item ) ,
597
+ 'item.type' : item . item . issue . type ,
598
+ 'item.provider' : item . item . issue . provider . id ,
599
+ 'item.assignees.count' : item . item . issue . assignees ?. length ?? undefined ,
600
+ 'item.createdDate' : item . item . issue . createdDate . getTime ( ) ,
601
+ 'item.updatedDate' : item . item . issue . updatedDate . getTime ( ) ,
602
+
603
+ 'item.comments.count' : item . item . issue . commentsCount ?? undefined ,
604
+ 'item.upvotes.count' : item . item . issue . thumbsUpCount ?? undefined ,
605
+
606
+ 'item.issue.state' : item . item . issue . state ,
607
+ } ;
608
+ }
609
+
618
610
function getOpenOnWebQuickInputButton ( integrationId : string ) : QuickInputButton | undefined {
619
611
switch ( integrationId ) {
620
612
case HostingIntegrationId . GitHub :
0 commit comments