-
Notifications
You must be signed in to change notification settings - Fork 0
/
defects.txt
664 lines (583 loc) · 31.8 KB
/
defects.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
Function Defects_ActionCanExecute(ActionName)
On Error Resume Next
Defects_ActionCanExecute = Project_DefaultRes
On Error GoTo 0
End Function
Sub Defects_Bug_New
On Error Resume Next
'Set the mandatory fields for new defects
Call SetupFields("New")
'Set the values in the status drop down list
Call SetStatus
'Set the reopen count to zero for a new defect
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).IsReadOnly = False
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).Value = 0
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).IsReadOnly = True
'Set the failed count to zero for a new defect
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).IsReadOnly = False
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).Value = 0
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).IsReadOnly = True
'Set the user name to user currently logged in and make this read only so can't be changed.
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_RAISED_BY)).IsReadOnly = False
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_RAISED_BY)).Value = User.UserName
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_RAISED_BY)).IsReadOnly = True
Bug_Fields.Field("BG_STATUS").IsReadOnly = True
On Error GoTo 0
End Sub
Sub Defects_Bug_MoveTo
On Error Resume Next
Call SetupFields(Bug_Fields.Field("BG_STATUS").Value)
On Error GoTo 0
End Sub
Function Defects_Bug_FieldCanChange(FieldName, NewValue)
On Error Resume Next
Defects_Bug_FieldCanChange = Project_DefaultRes
On Error GoTo 0
End Function
Sub Defects_Bug_FieldChange(FieldName)
On Error Resume Next
If FieldName = "BG_STATUS" Then
Call SetupFields(Bug_Fields.Field("BG_STATUS").Value)
Call SetStatus
End If
If FieldName = Bug_Fields.Field("BG_PROJECT") Then
If Bug_Fields.Field("BG_PROJECT").Value = "OP661" Then
SetFieldApp g_objBugLabelDictionary.Item(BG_SUB_PROJECT), True, True, 0, 5
SetFieldApp g_objBugLabelDictionary.Item(BG_OWNER), True, True, 2, 14
Else
SetFieldApp g_objBugLabelDictionary.Item(BG_SUB_PROJECT), True, False, 0, 5
SetFieldApp g_objBugLabelDictionary.Item(BG_OWNER), True, False, 2, 14
End If
End If
On Error GoTo 0
End Sub
Function Defects_Attachment_CanOpen(Attachment)
On Error Resume Next
Defects_Attachment_CanOpen = Project_DefaultRes
On Error GoTo 0
End Function
Function Defects_Attachment_CanPost(Attachment)
On Error Resume Next
Defects_Attachment_CanPost = Project_DefaultRes
On Error GoTo 0
End Function
Function Defects_Attachment_CanDelete(Attachment)
On Error Resume Next
Defects_Attachment_CanDelete = Project_DefaultRes
On Error GoTo 0
End Function
Function Defects_GetNewBugPageName(PageName,PageNum)
On Error Resume Next
Call SetupFields
Select Case PageNum
Case "1"
Defects_GetNewBugPageName="Details"
Case "2"
Defects_GetNewBugPageName="Testing"
Case Else
Defects_GetNewBugPageName="Planning"
End Select
On Error GoTo 0
End Function
Function Defects_GetDetailsPageName(PageName,PageNum)
On Error Resume Next
Call SetupFields(Bug_Fields.Field("BG_STATUS").Value)
Call SetStatus
Select Case PageNum
Case "1"
Defects_GetDetailsPageName="Details"
Case "2"
Defects_GetDetailsPageName="Testing"
Case Else
Defects_GetDetailsPageName="Planning"
End Select
On Error GoTo 0
End Function
Function Defects_Bug_CanPost
On Error Resume Next
Defects_Bug_CanPost = Project_DefaultRes
On Error GoTo 0
End Function
Sub SetFieldApp(FieldName, Vis, Req, PNo, VOrder)
'Sets a field's appearance
With Bug_Fields(FieldName)
.IsVisible = Vis
.IsRequired = Req
.PageNo = PNo
.ViewOrder = VOrder
End With
End Sub
Sub SetupFields(BugStatus)
'Set the default field states for defects
SetFieldApp "BG_SUMMARY", True, True, 0, 1 'Summary
SetFieldApp "BG_DESCRIPTION", True, True, 0, 2 'Description
'SetFieldApp g_objBugLabelDictionary.Item(BG_PROJECT_CODE), True, True, 0, 3 'Project Code
SetFieldApp "BG_PROJECT", True, True, 0, 3 'Project
SetFieldApp g_objBugLabelDictionary.Item(BG_APPLICATION), True, True, 0, 4 'System
SetFieldApp g_objBugLabelDictionary.Item(BG_SUB_PROJECT), True, False, 0,5 'Sub Project
SetFieldApp g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA), True, True, 0, 6 'Functional Area
SetFieldApp "BG_DETECTED_BY", True, True, 0, 7 'Detecty By
SetFieldApp "BG_SEVERITY", True, True, 0, 8 'Severity
SetFieldApp "BG_DETECTION_VERSION", True, True, 0, 9 'Detected in Version
SetFieldApp g_objBugLabelDictionary.Item(BG_TEST_PHASE), True, True, 0, 10 'Test Phase
SetFieldApp "BG_DETECTION_DATE", True, True, 0, 11 'Detected on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_ENVIRONMENT), True, True, 0, 12 'Environment
SetFieldApp "BG_PRIORITY", True, False, 0, 13 'Priority
SetFieldApp "BG_RESPONSIBLE", True, False, 0, 14 'Assigned To
SetFieldApp "BG_STATUS", True, True, 0, 15 'Status
SetFieldApp g_objBugLabelDictionary.Item(BG_ESTIMATED_RESOLUTION), True, False, 0, 16 ' est resolution
' Page 1 Fields
SetFieldApp g_objBugLabelDictionary.Item(BG_RAISED_BY), True, False, 1, 1 'Raised By
SetFieldApp "BG_SUBJECT", True, False, 1, 2 'Subject
SetFieldApp g_objBugLabelDictionary.Item(BG_TEST_CASE_ID), True, False, 1, 3 'Test Case ID
SetFieldApp "BG_REPRODUCIBLE", True, False, 1, 4 'Reproducible
SetFieldApp "BG_VTS", True, False, 1, 5 'Modified
SetFieldApp g_objBugLabelDictionary.Item(BG_DUPLICATE_OF_DEFECT), True, False, 1, 6 'Duplicate of
SetFieldApp g_objBugLabelDictionary.Item(BG_REASON_FOR_REJECTING), True, False, 1, 7 'Reason For Rejection
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE), True, False, 1, 8 'Tested on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_BY), True, False, 1, 9 'Tested By
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_IN_VERSION), True, False, 1, 10 'Tested In Version
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_ON_DATE), True, False, 1, 11 'Failed on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_BY), True, False, 1, 12 'Failed By
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_IN_VERSION), True, False, 1, 13 'Failed In Version
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_COUNT), True, False, 1, 14 'Failed count
SetFieldApp g_objBugLabelDictionary.Item(BG_REOPEN_COUNT), True, False, 1, 15 'Reopen count
SetFieldApp g_objBugLabelDictionary.Item(BG_BUILD_DATE), True, False, 1, 16 'Build Release Date
' Page 2 Fields
SetFieldApp "BG_TARGET_REL", True, False, 2, 1 'Target Release
SetFieldApp "BG_TARGET_RCYC", True, False, 2, 2 'Target Cycle
SetFieldApp "BG_ACTUAL_FIX_TIME", True, False, 2, 3 'Actual Fix Time
SetFieldApp "BG_ESTIMATED_FIX_TIME", True, False, 2, 4 'Estimated Fix Time
SetFieldApp g_objBugLabelDictionary.Item(BG_ESTIMATED_FIX_DATE), True, False, 2, 5 'Estimated Fix Date
SetFieldApp "BG_PLANNED_CLOSING_VER", True, False, 2, 6 'Planned closing ver
SetFieldApp "BG_CLOSING_VERSION", True, False, 2, 7 ' closing ver
SetFieldApp "BG_CLOSING_DATE", True, False, 2, 8 ' closing date
SetFieldApp "BG_DETECTED_IN_REL", True, False, 2, 9 'Detected in Release
SetFieldApp "BG_DETECTED_IN_RCYC", True, False, 2, 10 'Detected in Cycle
SetFieldApp g_objBugLabelDictionary.Item(BG_CR_REF), True, False, 2, 11 'CR Reference No.
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, False, 2, 12 'Root Cause
SetFieldApp g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE), True, False, 2, 13 'Fixed on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_REFERENCE), True, False, 2, 14 'Other Reference No.
SetFieldApp g_objBugLabelDictionary.Item(BG_OWNER), True, True, 2, 15 'Owner
SetFieldApp g_objBugLabelDictionary.Item(BG_MUREX_BINARY), True, False, 2, 16
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_RAISED_BY)).IsReadOnly = True
' Override the field states according to their status
Select Case BugStatus
Case "New"
' See if our user is one of Samantha-Jane's group
'If User.UserName = "samantha-jane.clark" Or User.UserName = "shefali.chandran" Or User.UserName = "paul.wilson" Or User.UserName = "peter.m.jones" Then
' Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_APPLICATION)).Value = "SwapClear Refresh (Murex)"
' Setup_Functional_Area_Lists
' Bug_Fields.Field("BG_DETECTION_VERSION").Value = "Murex Drop 1"
' Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_ENVIRONMENT)).Value = "SwapClear MUREX tswp01"
' Bug_Fields.Field("BG_PROJECT").Value = "OP661"
' Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TEST_PHASE)).Value = "Functional Test"
' Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_SUB_PROJECT)).Value = "Functional Test 1"
'End If
Case "Duplicate"
SetFieldApp g_objBugLabelDictionary.Item(BG_DUPLICATE_OF_DEFECT), True, True, 1, 6 'Duplicate of
Clear_Dates
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_ROOT_CAUSE)).Value = "Duplicate"
Case "Rejected"
SetFieldApp g_objBugLabelDictionary.Item(BG_REASON_FOR_REJECTING), True, True, 1, 7 'Reason For Rejection
Clear_Dates
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_ROOT_CAUSE)).Value = "Rejected"
Case "On Hold"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
Case "Assigned"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
Clear_Dates
Case "Open"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp "BG_ESTIMATED_FIX_TIME", True, False, 2, 4 'Estimated Fix Time
SetFieldApp g_objBugLabelDictionary.Item(BG_ESTIMATED_FIX_DATE), True, True, 2, 5
SetFieldApp "BG_PLANNED_CLOSING_VER", True, True, 2, 5 'Planned Closing Ver
SetFieldApp g_objBugLabelDictionary.Item(BG_ESTIMATED_RESOLUTION), True, True, 0, 16
Case "Fixed"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
SetFieldApp g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE), True, True, 2, 12 'Fixed on Date
SetFieldApp "BG_ESTIMATED_FIX_TIME", True, False, 2, 4 'Estimated Fix Time
SetFieldApp "BG_PLANNED_CLOSING_VER", True, True, 2, 5 'Planned Closing Ver
If Bug_Fields.Field("BG_PROJECT").Value <> "OP661" Then
SetFieldApp "BG_ACTUAL_FIX_TIME", True, True, 2, 3 'Actual Fix Time
Else
SetFieldApp "BG_ACTUAL_FIX_TIME", True, False, 2, 3 'Actual Fix Time
End If
If User.IsInGroup("LCHC_Development_Lead") Or User.IsInGroup("LCHC_Murex_Consultant") Then
SetFieldApp "BG_TARGET_REL", True, True, 2, 1
Else
SetFieldApp "BG_TARGET_REL", True, False, 2, 1
End If
Case "Tested"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
SetFieldApp g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE), True, True, 2, 12 'Fixed on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE), True, True, 1, 8 'Tested on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_BY), True, True, 1, 9 'Tested By
SetFieldApp g_objBugLabelDictionary.Item(BG_TESTED_IN_VERSION), True, True, 1, 10 'Tested In Version
SetFieldApp "BG_ESTIMATED_FIX_TIME", True, False, 2, 4 'Estimated Fix Time
SetFieldApp "BG_PLANNED_CLOSING_VER", True, True, 2, 5 'Planned Closing Ver
SetFieldApp "BG_ACTUAL_FIX_TIME", True, False, 2, 3 'Actual Fix Time
Case "Closed"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE)).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE)).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_BY)).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item("BG_ESTIMATED_FIX_TIME")).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item("BG_PLANNED_CLOSING_VER")).IsReadOnly = True
Bug_Fields.Field(g_objBugLabelDictionary.Item("BG_ACTUAL_FIX_TIME")).IsReadOnly = True
SetFieldApp "BG_CLOSING_VERSION", True, True, 2, 6 'closing Version
SetFieldApp "BG_CLOSING_DATE", True, True, 2, 7 'Closing Date
Case "Reopen"
SetFieldApp g_objBugLabelDictionary.Item(BG_REOPEN_COUNT), True, False, 1, 10 'Reopen count
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
Clear_Dates
Case "Ready for Testing"
SetFieldApp g_objBugLabelDictionary.Item(BG_BUILD_DATE), True, True, 1, 11 'Build Release Date
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp "BG_PLANNED_CLOSING_VER", True, True, 2, 5 'Planned Closing Ver
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
SetFieldApp g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE), True, True, 2, 12 'Fixed on Date
If User.IsInGroup("LCHC_Development_Lead") Then
SetFieldApp "BG_TARGET_REL", True, True, 2, 1
End If
Case "Failed Testing"
SetFieldApp "BG_RESPONSIBLE", True, True, 0, 14 'Assigned To
SetFieldApp "BG_PRIORITY", True, True, 0, 13 'Priority
SetFieldApp g_objBugLabelDictionary.Item(BG_ROOT_CAUSE), True, True, 2, 11 'Root Cause
SetFieldApp g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE), True, True, 2, 12 'Fixed on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_ON_DATE), True, True, 1, 11 'Failed on Date
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_BY), True, True, 1, 12 'Failed By
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_IN_VERSION), True, True, 1, 13 'Failed In Version
SetFieldApp "BG_ESTIMATED_FIX_TIME", True, False, 2, 4 'Estimated Fix Time
SetFieldApp "BG_PLANNED_CLOSING_VER", True, False, 2, 5 'Planned Closing Ver
SetFieldApp "BG_ACTUAL_FIX_TIME", True, False, 2, 3 'Actual Fix Time
SetFieldApp g_objBugLabelDictionary.Item(BG_FAILED_COUNT), True, False, 1, 14 'Failed count
End Select
End Sub
Sub SetStatus
'Set the lists available in the status field. This ensures that the defect flow is followed.
Select Case Bug_Fields("BG_STATUS").Value
Case "Assigned"
Bug_Fields("BG_STATUS").List = Lists("Status_Assigned")
Case "Closed"
Bug_Fields("BG_STATUS").List = Lists("Status_Closed")
Case "Duplicate"
Bug_Fields("BG_STATUS").List = Lists("Status_Duplicate")
Case "Fixed"
Bug_Fields("BG_STATUS").List = Lists("Status_Fixed")
Case "New"
Bug_Fields("BG_STATUS").List = Lists("Status_New")
Case "On Hold"
Bug_Fields("BG_STATUS").List = Lists("Status_OnHold")
Case "Open"
Bug_Fields("BG_STATUS").List = Lists("Status_Open")
Case "Rejected"
Bug_Fields("BG_STATUS").List = Lists("Status_Rejected")
Case "Reopen"
Bug_Fields("BG_STATUS").List = Lists("Status_Reopen")
Case "Tested"
Bug_Fields("BG_STATUS").List = Lists("Status_Tested")
Case "Failed Testing"
Bug_Fields("BG_STATUS").List = Lists("Status_Failed")
Case "Ready for Testing"
Bug_Fields("BG_STATUS").List = Lists("Status_Ready")
End Select
End Sub
Function Defects_InitNewTask(Items, NewTask)
On Error Resume Next
Defects_InitNewTask = Project_DefaultRes
On Error GoTo 0
End Function
Sub Defects_AssignLabels
On Error Resume Next
Dim colBugFields
Dim intBugFieldNumber
Set g_objBugLabelDictionary = CreateObject("Scripting.Dictionary")
Set colBugFields = TDConnection.BugFactory.Fields
For intBugFieldNumber = 1 To colBugFields.Count
Select Case colBugFields.Item(intBugFieldNumber).Property.UserLabel
Case BG_REOPEN_COUNT
g_objBugLabelDictionary.Add BG_REOPEN_COUNT, colBugFields.Item(intBugFieldNumber)
Case BG_DUPLICATE_OF_DEFECT
g_objBugLabelDictionary.Add BG_DUPLICATE_OF_DEFECT, colBugFields.Item(intBugFieldNumber)
Case BG_RAISED_BY
g_objBugLabelDictionary.Add BG_RAISED_BY, colBugFields.Item(intBugFieldNumber)
Case BG_TEST_PHASE
g_objBugLabelDictionary.Add BG_TEST_PHASE, colBugFields.Item(intBugFieldNumber)
Case BG_ENVIRONMENT
g_objBugLabelDictionary.Add BG_ENVIRONMENT, colBugFields.Item(intBugFieldNumber)
Case BG_TEST_CASE_ID
g_objBugLabelDictionary.Add BG_TEST_CASE_ID, colBugFields.Item(intBugFieldNumber)
Case BG_REASON_FOR_REJECTING
g_objBugLabelDictionary.Add BG_REASON_FOR_REJECTING, colBugFields.Item(intBugFieldNumber)
Case BG_ROOT_CAUSE
g_objBugLabelDictionary.Add BG_ROOT_CAUSE, colBugFields.Item(intBugFieldNumber)
Case BG_TESTED_ON_DATE
g_objBugLabelDictionary.Add BG_TESTED_ON_DATE, colBugFields.Item(intBugFieldNumber)
Case BG_TESTED_BY
g_objBugLabelDictionary.Add BG_TESTED_BY, colBugFields.Item(intBugFieldNumber)
Case BG_FIXED_ON_DATE
g_objBugLabelDictionary.Add BG_FIXED_ON_DATE, colBugFields.Item(intBugFieldNumber)
Case BG_APPLICATION
g_objBugLabelDictionary.Add BG_APPLICATION, colBugFields.Item(intBugFieldNumber)
Case BG_FUNCTIONAL_AREA
g_objBugLabelDictionary.Add BG_FUNCTIONAL_AREA, colBugFields.Item(intBugFieldNumber)
Case BG_REFERENCE
g_objBugLabelDictionary.Add BG_REFERENCE, colBugFields.Item(intBugFieldNumber)
Case BG_SUB_PROJECT
g_objBugLabelDictionary.Add BG_SUB_PROJECT, colBugFields.Item(intBugFieldNumber)
Case BG_CR_REF
g_objBugLabelDictionary.Add BG_CR_REF, colBugFields.Item(intBugFieldNumber)
Case BG_OWNER
g_objBugLabelDictionary.Add BG_OWNER, colBugFields.Item(intBugFieldNumber)
Case BG_TESTED_IN_VERSION
g_objBugLabelDictionary.Add BG_TESTED_IN_VERSION, colBugFields.Item(intBugFieldNumber)
Case BG_FAILED_IN_VERSION
g_objBugLabelDictionary.Add BG_FAILED_IN_VERSION, colBugFields.Item(intBugFieldNumber)
Case BG_FAILED_ON_DATE
g_objBugLabelDictionary.Add BG_FAILED_ON_DATE, colBugFields.Item(intBugFieldNumber)
Case BG_FAILED_BY
g_objBugLabelDictionary.Add BG_FAILED_BY, colBugFields.Item(intBugFieldNumber)
Case BG_FAILED_COUNT
g_objBugLabelDictionary.Add BG_FAILED_COUNT, colBugFields.Item(intBugFieldNumber)
Case BG_BUILD_DATE
g_objBugLabelDictionary.Add BG_BUILD_DATE, colBugFields.Item(intBugFieldNumber)
Case BG_ESTIMATED_FIX_DATE
g_objBugLabelDictionary.Add BG_ESTIMATED_FIX_DATE, colBugFields.Item(intBugFieldNumber)
Case BG_MUREX_BINARY
g_objBugLabelDictionary.Add BG_MUREX_BINARY, colBugFields.Item(intBugFieldNumber)
Case BG_ESTIMATED_RESOLUTION
g_objBugLabelDictionary.Add BG_ESTIMATED_RESOLUTION, colBugFields.Item(intBugFieldNumber)
End Select
Next
On Error GoTo 0
End Sub
Function Bug_CanPost
On Error Resume Next
strDescription = Bug_Fields.Field("BG_DESCRIPTION").Value
If Len(strDescription) < 60 Then
MsgBox "Please enter sufficient detail in the description field!", vbExclamation, "Warning"
Bug_CanPost = False
Else
Bug_CanPost = DefaultRes
End If
strStatus = Bug_Fields.field("BG_STATUS").Value
If strStatus = "Reopen" Then
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).IsReadOnly = False
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).Value = Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).Value + 1
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_REOPEN_COUNT)).IsReadOnly = True
End If
If strStatus = "Assigned" Then
If g_SendToMurex = "True" Then
rc = Bug_Fields.Field(GetFieldName("Owner","BUG")).Value
If Instr(1,rc,"- Issue") > 0 Or Instr(1, rc, "- Strategic") > 0 Then
g_SendToMurex = "False"
Exit Function
End If
rc = Bug_Fields.Field(GetFieldName("3rd Party Reference ID", "BUG")).Value
If rc = "" Then
Bug_Fields.Field(GetFieldName("3rd Party Reference ID", "BUG")).Value = "Awaiting Murex Case Id"
End If
End If
End If
rc = Bug_Fields.Field(GetFieldName("3rd Party Reference ID", "BUG")).Value
If rc <> "" Then
If rc = "Awaiting Murex Case Id" Then
g_SendToMurex = "True"
Else
If Len(rc) = 6 Then
g_SendToMurex = "True"
Else
g_SendToMurex = "False"
End If
End If
End If
On Error GoTo 0
End Function
Sub Clear_Dates
On Error Resume Next
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_BUILD_DATE)).Value = ""
Bug_Fields.Field("BG_PLANNED_CLOSING_VER").Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_BY)).Value = ""
Bug_Fields.Field("BG_CLOSING_VERSION").Value = ""
Bug_Fields.Field("BG_ACTUAL_FIX_TIME").Value = ""
Bug_Fields(g_objBugLabelDictionary.Item(BG_ROOT_CAUSE)).Value = ""
Bug_Fields.Field("BG_CLOSING_DATE").Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_IN_VERSION)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_ON_DATE)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_IN_VERSION)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_BY)).Value = ""
On Error GoTo 0
End Sub
Sub Update_Dates
On Error Resume Next
Select Case Bug_Fields("BG_STATUS").Value
Case "Closed"
' Auto-populate the Closing Date field.
Bug_Fields.Field("BG_CLOSING_DATE").Value = Date
Case "Tested"
' Auto-populate the Tested By and Tested On Date fields.
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_BY)).Value = User.UserName
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE)).Value = Date
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
Case "Fixed"
' Auto-populate the Fixed On Date field.
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FIXED_ON_DATE)).Value = Date
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
Case "Ready for Testing"
' Auto-populate the Fixed On Date field.
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_BUILD_DATE)).Value = Date
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_IN_VERSION)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_BY)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_TESTED_ON_DATE)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_ON_DATE)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_IN_VERSION)).Value = ""
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_BY)).Value = ""
Case "Reopen"
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
Case "Failed Testing"
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_BY)).Value = User.UserName
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_ON_DATE)).Value = Date
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).IsReadOnly = False
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).Value = Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).Value + 1
Bug_Fields.Field(g_objBugLabelDictionary.Item(BG_FAILED_COUNT)).IsReadOnly = True
Case "Assigned"
Bug_Fields.Field("BG_RESPONSIBLE").Value = "" 'Clear Assigned to value
End Select
On Error GoTo 0
End Sub
Sub Bug_FieldChange(FieldName)
On Error Resume Next
If FieldName = "BG_STATUS" Then
Update_Dates
End If
' See if the assigned to field is moving from or to a murex consultant
If FieldName = "BG_RESPONSIBLE" Then
rc = CheckUserGroup(Bug_Fields.Field("BG_RESPONSIBLE").Value)
If rc = "True" Then
g_SendToMurex = "True"
Else
g_SendToMurex = "False"
End If
End If
Setup_Functional_Area_Lists
On Error GoTo 0
End Sub
Sub Bug_MoveTo
On Error Resume Next
Setup_Functional_Area_Lists
On Error GoTo 0
End Sub
Sub Setup_Functional_Area_Lists
On Error Resume Next
Select Case Bug_Fields(g_objBugLabelDictionary.Item(BG_APPLICATION)).Value
Case "Banking"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Banking Functional Area")
Case "Blade Logic (Model Office)"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Blade Logic Functional Area")
Case "Clearing GUI"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Clearing GUI Functional Area")
Case "Curve Builder GUI"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Curve Builder Functional Area")
Case "Curve Checker GUI"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Curve Checker Functional Area")
Case "DMP"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("DMP Functional Area")
Case "ITD Deletions"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("ITD Deletions Functional Area")
Case "Margin Monitor GUI"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Margin Monitor Functional Area")
Case "Markit Curve"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Markit Curve Functional Area")
Case "Member Reporting"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Member Reporting Functional Area")
Case "MIDAS"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("MIDAS Functional Area")
Case "Price Server"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Price Server Functional Area")
Case "RMS"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("RMS Functional Area")
Case "SwapClear"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("SwapClear Functional Area")
Case "SWIFT"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("SWIFT Functional Area")
Case "Markit Wire"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("MarkitWire Functional Area")
Case "SwapClear Refresh (Murex)"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("SwapClear Refresh (Murex) Functional Area")
Case "SwapClear Refresh (LCH)"
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("SwapClear Refresh (LCH) Functional Area")
Case Else
Bug_Fields(g_objBugLabelDictionary.Item(BG_FUNCTIONAL_AREA)).List = Lists("Functional Area")
End Select
On Error GoTo 0
End Sub
Function Bug_FieldCanChange(FieldName, NewValue)
On Error Resume Next
' See if the assigned to field is moving from or to a murex consultant
If FieldName = "BG_RESPONSIBLE" Then
rc = CheckUserGroup(NewValue)
If rc = "True" Then
g_SendToMurex = "True"
Else
g_SendToMurex = "False"
End If
End If
Bug_FieldCanChange = DefaultRes
On Error GoTo 0
End Function
Sub Bug_AfterPost
On Error Resume Next
If g_SendToMurex = "True" Then
SendDefect Bug_Fields.Field("BG_BUG_ID").Value, "[email protected]","[email protected]","Defect Assigned to Murex","LCH.Clearnet Quality Center Defect"
End If
If Bug_Fields.Field("BG_STATUS").Value = "New" Then
SendDefect Bug_Fields.Field("BG_BUG_ID").Value, "[email protected]","[email protected]","New Critial or High Defect Raised.","Please review as soon as possible."
End If
On Error GoTo 0
End Sub
Function CheckUserGroup(strUserName)
Dim objCustomization
Dim objCustomizationUsers
Dim objCustomizationUser
Set objCustomization = TDConnection.Customization
Set objCustomizationUsers = objCustomization.Users
Set objCustomizationUser = objCustomizationUsers.User(strUserName)
If objCustomizationUser.InGroup("LCHC_Murex_Consultant") = True Then
CheckUserGroup = "True"
Else
CheckUserGroup = "False"
End If
Set objCustomizationUser = Nothing
Set objCustomizationUsers = Nothing
Set objCustomization = Nothing
End Function
Sub SendDefect (iObjectId, strTo, strCc, strSubject, strComment)
On Error Resume Next
Dim objBugFactory, objBug
Set objBugFactory = TDConnection.BugFactory
Set objBug = objBugFactory.Item(iObjectId)
objBug.Mail strTo, strCc, 1, strSubject, strComment
Set objBug = Nothing
Set objBugFactory = Nothing
On Error GoTo 0
End Sub