How Can I Join Issues to Components?
Question
Using the legacy Jira schema, I could join issues to components using the ISSUE_COMPONENTS table, which connected directly to the ISSUE and COMPONENT tables. However, that join table isn't in the current schema. The COMPONENT table still exists, but it links to the PROJECT table rather than the ISSUE table. How can I find out which components are assigned to which issues?
Environment
Connector: Jira
Answer
The new Jira ERD captures issue field values differently. Instead of dedicated join tables like ISSUE_COMPONENTS, we store issue field data in two central history tables:
ISSUE_FIELD_HISTORYfor single-value fieldsISSUE_MULTISELECT_HISTORYfor multi-value fields
The COMPONENT table still contains metadata, but is no longer directly related to issues. To retrieve component values assigned to issues, do the following:
- Use the
FIELDtable to find the ID for thecomponentfield. - Join the
FIELDtable with eitherISSUE_FIELD_HISTORYorISSUE_MULTISELECT_HISTORYto locate component values. - Use the
is_activeflag in the history tables to filter for the most recent (active) values. - Use the IDs in the
valuecolumn to join to theCOMPONENTtable and retrieve component names or other metadata.