Subcomponents is one of the most requested feature of JIRA. As of today there are nearly 800 votes for the issue JRA-846. Also there are duplicate issues which are closed as being duplicate. So, why people are asking for subcomponents? Here is a few use cases where subcomponets makes your issue management easier.
Consider a big project, it will consist of various teams developing a different part of the project potentially different release schedules, using different programing languages and tools. Consider an ERP project. You will have different APIs for different organizations (Banks, Governments etc), different databases supported, functionalities like Payment, Human Resources, Project Management, etc. Suppose that we have created each of these entities as different components. Lets make a more details breakdown of Databases. Assume that our ERP supports Oracle, MySQL and PostgreSQL and we have created a component for each of them, so that our QA team and customers could create, search issues depending on their database vendor. If we repeat this for other functional areas we will have tens of components in our ERP project. Finding correct component to report an issue will be difficult for QA and our customers but it will also be more difficult for our development team too. Consider our database team, most probably they will have queries something like:
project=ERP and component in [Oracle, MySQL, PostgreSQL] .....
If a new database is added to our product they will need to update all of these JQL statements to include new database name. It is an error prone approach. Solution is to group all of the related components under a common parent component and use this parent component whenever you want to refer all of the related components as a group. Lets continue our database example and define a parent component ‘Database’:
Database Oracle MySQL PostgreSQL
In that scenario our JQL will be like this:
project=ERP and component in subcomponentsof('Database')
How you organize your components is directly depends on nature of your project, here some common organization schemas.
Organize Components as System and Subsystem
Consider an Aircraft project, every major part (Engine, Flight Control, Communication, etc) could be a system and there could be subsystems (Cooling, Fire Protection, etc) inside them:
System A Subsystem B Subsystem C System X Subsystem Alpha Subsystem Beta
Organize Components as Hardware and Software
In some organizations and projects there may be hardware and software working in parallel. These teams may want to organize their components as hardware and software.
System Hardware Board CPU Software Firmware Bootstrap
Organize Components Depending on Outsource Company or Vendor
Some projects are mostly integration projects and different vendors may be responsible for different components. In that projects you may want to group all of the components assigned a specific vendor:
System Vendor A Component 1 Component 2 Vendor B Component X Component Y
This subcomponent or in other words component hierarchy is not directly supported by JIRA. We have added Subcomponents feature to our Component/Subcomponent/Bundle Versions plugin to meet requirements of all organizations who needs this kind of component hierarchy. We think that it answers all the scenarios listed in comments of issue JRA-846. If you need additional feature, please let us know.
How Subcomponents Work?
Plugin allows you to group components under a component tree. Nodes of this tree could be Virtual Components, or Real Components(Which are usual JIRA Components). You can nest components in any level you like.
Virtual Components: These are a new type of components normally not available in JIRA. You can create them inside “Subcomponents” tab of project’s administration page. Using them is optional. They allow you to better represent type of work/module kind of components. Since they are not real JIRA components, you can’t create issues for them. If you select them for issue creation, issue is associated with all of the real components grouped under the virtual component.
Real Components: These are normal JIRA components created from “Components” tab of your project’s administrative screen. You can also create them inside “Subcomponents” tab. Both actions do the same thing. Like Virtual Components, Real Components also allows other components (Virtual or Real) to be grouped under them. In addition to virtual components, you can also create issues for Real Components. They stay as they are even if you decide to uninstall the plugin someday.
Above example shows one grouping of subcomponents for a hypothetical ERP project. In addition to modules developed by the team, it also shows different databases supported by the platform under “Databases” virtual component. Since “Databases” isn’t a real component any issue opened to it is automatically assigned to 3 databases (Oracle, Postgres, MySQL) under the virtual component.
Of course component selection tree is available inside quick edit menu of issue page. It is opened with the same icon. Using subcomponents doesn’t hide usual way of selecting components, autocomplete text field. It just complements it with another way of selecting components.
Selecting a parent component (whether it is virtual or not) will automatically select all of it’s visible children of it. The same way unselecting a parent component will select all of it’s visible children. With respect to selection the difference between a virtual parent component and a real parent component is real parent components are also added to components field of the issue whereas virtual components are not.
The plugin also contains subcomponentsof function to allow you to query all issues opened to a component hierarchy. It returns all subcomponents of a component in a recursive way. This returns parent component itself, if you do not want it to be included you can pass a 2nd argument to JQL function, which should be false to exclude parent component itself or it should be true to include parent component itself. Default value is true.
project = ERP and component in subcomponentsof("API")
You can pass name of a virtual or real component to this method. It will return all components which is contains all real components which are the subcomponents of the given component, including the given component itself. You can use subcomponentsof clause anywhere you can use multiple components in JQL. You can add your own clauses to restrict returned results, it is a standard JQL.