Sure,
This is the one that works:
SELECT CONCAT (p.pkey, CONCAT (‘-’, i.issuenum)) AS ID,
t.PNAME,
s.pname AS Durum,
r.pname COZUMDURUMU,
i.summary,
u.FIRST_NAME || ’ ’ || u.LAST_NAME Atanacak_Kisi,
v5.STRINGVALUE Mudurluk,
CASE
WHEN t.PNAME = ‘Geliştirme Talebi’ THEN a.APP_CATALOG_CODE
WHEN t.PNAME = ‘Operasyonel Talep’ THEN otl.CODE
END UYGULAMAKODU,
otl.ID,
i.CREATED,
i.RESOLUTIONDATE,
v6.DATEVALUE STDEGERLENDIRMETARIHI
FROM SDLC_JIRA.JIRAISSUE i
LEFT JOIN SDLC_JIRA.PROJECT p ON p.ID = i.PROJECT
LEFT JOIN SDLC_JIRA.ISSUESTATUS s ON s.ID = i.issuestatus
LEFT JOIN SDLC_JIRA.RESOLUTION r ON r.ID = i.resolution
LEFT JOIN SDLC_JIRA.ISSUETYPE t ON t.ID = i.issuetype
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 32965) v
ON i.ID = v.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 31301) v2
ON i.ID = v2.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 10094) v3
ON i.ID = v3.ISSUE
LEFT JOIN
(SELECT CONCAT (p.pkey, CONCAT (‘-’, a.issuenum)) AS ID,
c.APP_CATALOG_CODE CODE
FROM SDLC_JIRA.JIRAISSUE a
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 32965) b
ON a.ID = b.ISSUE
LEFT JOIN SDLC_JIRA.PROJECT p ON p.ID = a.PROJECT
LEFT JOIN SDLC_COMMON.IBS_ASSET c ON c.ID = b.STRINGVALUE
WHERE a.ISSUETYPE = 12003) otl
ON CAST (v2.TEXTVALUE AS VARCHAR2 (50)) = otl.ID
LEFT JOIN SDLC_COMMON.IBS_ASSET a ON a.ID = v.STRINGVALUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 17000) v4
ON i.ID = v4.ISSUE
LEFT JOIN (SELECT DISTINCT LOWER_USER_NAME, FIRST_NAME, LAST_NAME
FROM SDLC_JIRA.CWD_USER
WHERE DIRECTORY_ID = 10400) u
ON u.LOWER_USER_NAME = v4.STRINGVALUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 33165) v5
ON i.ID = v5.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 33177) v6
ON i.ID = v6.ISSUE
WHERE i.issuetype IN (10005)
–AND v5.STRINGVALUE = ‘Uygulama Destek Müdürlüğü – 1’;
And this is the one that does not:
SELECT CONCAT (p.pkey, CONCAT (‘-’, i.issuenum)) AS ID,
t.PNAME,
s.pname AS Durum,
r.pname COZUMDURUMU,
i.summary,
u.FIRST_NAME || ’ ’ || u.LAST_NAME Atanacak_Kisi,
v5.STRINGVALUE Mudurluk,
CASE
WHEN t.PNAME = ‘Geliştirme Talebi’ THEN a.APP_CATALOG_CODE
WHEN t.PNAME = ‘Operasyonel Talep’ THEN otl.CODE
END UYGULAMAKODU,
otl.ID,
i.CREATED,
i.RESOLUTIONDATE,
v6.DATEVALUE STDEGERLENDIRMETARIHI
FROM SDLC_JIRA.JIRAISSUE i
LEFT JOIN SDLC_JIRA.PROJECT p ON p.ID = i.PROJECT
LEFT JOIN SDLC_JIRA.ISSUESTATUS s ON s.ID = i.issuestatus
LEFT JOIN SDLC_JIRA.RESOLUTION r ON r.ID = i.resolution
LEFT JOIN SDLC_JIRA.ISSUETYPE t ON t.ID = i.issuetype
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 32965) v
ON i.ID = v.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 31301) v2
ON i.ID = v2.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 10094) v3
ON i.ID = v3.ISSUE
LEFT JOIN
(SELECT CONCAT (p.pkey, CONCAT (‘-’, a.issuenum)) AS ID,
c.APP_CATALOG_CODE CODE
FROM SDLC_JIRA.JIRAISSUE a
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 32965) b
ON a.ID = b.ISSUE
LEFT JOIN SDLC_JIRA.PROJECT p ON p.ID = a.PROJECT
LEFT JOIN SDLC_COMMON.IBS_ASSET c ON c.ID = b.STRINGVALUE
WHERE a.ISSUETYPE = 12003) otl
ON CAST (v2.TEXTVALUE AS VARCHAR2 (50)) = otl.ID
LEFT JOIN SDLC_COMMON.IBS_ASSET a ON a.ID = v.STRINGVALUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 17000) v4
ON i.ID = v4.ISSUE
LEFT JOIN (SELECT DISTINCT LOWER_USER_NAME, FIRST_NAME, LAST_NAME
FROM SDLC_JIRA.CWD_USER
WHERE DIRECTORY_ID = 10400) u
ON u.LOWER_USER_NAME = v4.STRINGVALUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 33165) v5
ON i.ID = v5.ISSUE
LEFT JOIN (SELECT *
FROM SDLC_JIRA.CUSTOMFIELDVALUE
WHERE CUSTOMFIELD = 33177) v6
ON i.ID = v6.ISSUE
WHERE i.issuetype IN (10005)
AND v5.STRINGVALUE = ‘Uygulama Destek Müdürlüğü – 1’;
The only difference is the “–” characters before the AND statement at the end.
Thanks.