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:
|
SELECT SUM(
CASE AP2.AP_FIELD_NAME
WHEN 'BG_Responsible' THEN 1
ELSE 0
END) CHANGE_HANDS,
BUG.BG_BUG_ID DEFECT_ID,
ISNULL(BUG.BG_PLANNED_CLOSING_VER,'NULL') PLANNED_CLOSING_VER,
BUG.BG_STATUS STATUS,
BUG.BG_SEVERITY SEVERITY,
ISNULL(BUG.BG_USER_14,'NULL') SEC_STATUS,
BUG.BG_RESPONSIBLE ASSIGNED_TO,
ISNULL(BUG.BG_USER_62,'NULL') CIO_GROUP ,
CONVERT(VARCHAR(10),BUG.BG_DETECTION_DATE,101) DETECTED_ON_DT,
ISNULL(BUG.BG_USER_18,'NULL') REOPEN_DATE,
ISNULL(BUG.BG_USER_57,'NULL') ROOT_CAUSE_DATE,
CONVERT(VARCHAR(10),BUG.BG_CLOSING_DATE,101) CLOSING_DATE,
CONVERT(VARCHAR(10),BUG.BG_USER_04,101) ACTUAL_FIXED_DATE,
ISNULL(BUG.BG_USER_07,'NULL') [TEST PHASE],
ISNULL(AL1.AU_USER,'NULL') CHANGER,
ISNULL(CONVERT(VARCHAR(10), AL1.AU_TIME, 101),'NULL') CHANGE_DATE,
ISNULL(AP1.AP_OLD_VALUE,'NULL') OLD_VALUE,
ISNULL(AP2.AP_NEW_VALUE,'NULL') NEW_VALUE,
DATEDIFF(dw,BG_DETECTION_DATE,GETDATE()) - (DATEDIFF(wk,BG_DETECTION_DATE,GETDATE()) * 2) AGING,
ISNULL(AP2.AP_FIELD_NAME, 'NULL') FIELDNAME,
BUG.BG_USER_71 DOLLAR_AMOUNT,
BUG.BG_USER_72 NUM_OF_RECORDS,
BUG.BG_USER_75 BASEL_DATA_ELEMENT,
BUG.BG_USER_76 BASEL_DATA_ELEMENT_VALUES
from AUDIT_LOG AL1
Inner Join AUDIT_PROPERTIES AP1 On AL1.AU_ACTION_ID = AP1.AP_ACTION_ID
Inner Join AUDIT_PROPERTIES AP2 On AL1.AU_ACTION_ID = AP2.AP_ACTION_ID And AP1.AP_FIELD_NAME = AP2.AP_FIELD_NAME
Inner Join BUG On AL1.AU_ENTITY_ID = CAST(BUG.BG_BUG_ID AS VARCHAR(200))
where AP2.AP_FIELD_NAME In ('bg_status', 'bg_responsible', 'BG_USER_14')
AND BUG.BG_USER_09 = 'Defect'
AND BUG.BG_USER_53 <> 'No'
AND BUG.BG_USER_55 <> 'Yes'
AND BUG.BG_USER_06 NOT IN ('CRDS','DQS')
AND BUG.BG_PROJECT NOT IN ('A Test SOR','AQ Forecasting','ECR ECRIS Back End', 'ECR_Front End Portal')
AND BUG.BG_USER_07 IN ('Prod Emulation 1','Prod Emulation 10','Prod Emulation 11','Prod Emulation 12','Prod Emulation 2','Prod Emulation 3',
'Prod Emulation 4','Prod Emulation 5','Prod Emulation 6','Prod Emulation 7','Prod Emulation 8','Prod Emulation 9',
'SIT - Refresh 1','SIT - Refresh1','SIT - Refresh 2','SIT - Refresh 3','SIT - Refresh 4','SIT - Refresh 5','SIT - Refresh 6',
'SIT - Refresh 7','SIT - Refresh 7a','SIT - Refresh 8','SIT - Refresh 9','SIT - Refresh 10','UAT - Refresh 1','UAT - Refresh 2',
'UAT- Refresh 3','UAT- Refresh 4','UAT- Refresh 5','UAT- Refresh 6','UAT- Refresh 7','UAT - Refresh 7a','UAT - Refresh 8',
'UAT - Refresh 9','UAT - Refresh 10','SOR SIT','SOR UAT')
GROUP BY
BUG.BG_USER_07,
BUG.BG_USER_71,
BUG.BG_USER_72,
BUG.BG_USER_75,
BUG.BG_USER_76,
BUG.BG_BUG_ID,
BUG.BG_PLANNED_CLOSING_VER,
BUG.BG_STATUS,
BUG.BG_SEVERITY,
BUG.BG_USER_14,
BUG.BG_RESPONSIBLE,
BUG.BG_USER_62,
BUG.BG_DETECTION_DATE,
BG_USER_18,
BG_USER_57,
BUG.BG_CLOSING_DATE,
BUG.BG_USER_04,
AL1.AU_USER,
AL1.AU_TIME,
AP1.AP_OLD_VALUE,
AP2.AP_NEW_VALUE,
AP2.AP_FIELD_NAME
Order By
BUG.BG_BUG_ID,
AL1.AU_TIME
|