Problem
A selected custom field value, that is in a MS SQL Server JIRA Database should be retrieved.
Ansatz – Approach
The tables project_key, jiraissue, CustomFieldValue, customfield and customfieldoption have to be joined
Lösung – Solution
SELECT pk.PROJECT_KEY+'-'+CAST(a.issuenum AS varchar(max)) as issue, c.cfname as field, d.customvalue FROM project_key pk INNER JOIN jiraissue a ON pk.PROJECT_ID=a.PROJECT INNER JOIN CustomFieldValue b ON a.ID=b.ISSUE INNER JOIN customfield c ON b.CUSTOMFIELD=c.id INNER JOIN customfieldoption d ON c.id=d.CUSTOMFIELD WHERE c.CFName = 'Requirements/Specifications affected?' AND b.STRINGVALUE=CAST(d.id as varchar(max))