I have a number of custom fields defined but 4 of them are single select lists. I am using external tools to pull data from our Oracle 11g instance (our dbase used for JIRA) and am having an issue with getting data from 2 of the 4. All 4 are single selects where one of the four have an option for either YES or NO the other 3 all have an identical thirteen item to choose from. For purposes of explaining lets say this is custom fields called A, B, C, and D. A has the YES/NO configuration. B, C, and D all have the thirteen items to pick from. I can use the same subquery to get a single row returned for B and D consistently with no problems as follows:
select
J.Pkey, J. ID, J.Duedate,
(select CFO.CustomValue from jiraaudit.CustomField CF, jiraaudit.CustomFieldValue CFV, jiraaudit.CustomFieldOption CFO where CF.CFName = 'B' And CF.Id = CFV.CustomField And CFV.Issue = J.Id And CFO.CustomField = CF.Id And CFV.StringValue = To_Char(CFO.Id)) B_Field,
(select IStatus.Pname from jiraaudit.IssueStatus IStatus where IStatus.Id = J.IssueStatus) Issue_Status
From jiraaudit.JiraIssue J, JiraAudit.Project P
Where J.Project = P.Id And P.Pname = 'Project 1'
Order by J.Pkey
But if I change to this:
(select CFO.CustomValue from jiraaudit.CustomField CF, jiraaudit.CustomFieldValue CFV, jiraaudit.CustomFieldOption CFO where CF.CFName = 'C' And CF.Id = CFV.CustomField And CFV.Issue = J.Id And CFO.CustomField = CF.Id And CFV.StringValue = To_Char(CFO.Id)) B_Field,
(select IStatus.Pname from jiraaudit.IssueStatus IStatus where IStatus.Id = J.IssueStatus) Issue_Status
From jiraaudit.JiraIssue J, JiraAudit.Project P
Where J.Project = P.Id And P.Pname = 'Project 1'
Order by J.Pkey
I will get
ORA-10427: Single-row subquery returns more than one row error.
The really strange part of this is that the definitions for fields B, C, and D are identical other than they have different names defined in the CustomField table. Now, for the disclaimer I am not a DBA by trade so this one is just eluding me. The documentation for the database schema for v5.9 or v5. anything is not to be found. If anyone can shed some light on this for me it would be most appreciated.
Thanks, Bryan