Affects Version/s: 1.11.3
Fix Version/s: 1.12.0
This would address the following use-case (not sure it applies to everyone):
- Given a versioned product (Bundle) with many Versioned Components (CmpVersionMapping + BundleContent), I can associate the two together in a relatively simple way.
This is how I currently do it is as follows:
- Create a Product object (our own thing--just a versioned product that has versioned components, with methods that wrap your plugin to persist itself to Jira)
- Create the Version for the Bundle
- Create the Bundle against a Project and Bundle's Version
- Use cvService.addBundle(BundleImp) to add the bundle to Jira
- Create the Jira Component
- Create the Jira Version for the Jira Component
- Use cvService.addMapping(CmpVersionMappingImp) to create the Versioned Component from the Component + Component's Version
- Get the Bundle ID, Component ID, and Component's Version ID
- Use cvService.addContentToBundle(BundleContentImp) to create the BundleContent from the Bundle ID, Component ID, and Component's Version ID
The thing that strikes me as a bit weird is how the mapping between the Bundle and Versioned Component is a separate thing that take the Component and Version Ids as arguments.
- Why not offer an API that takes a CmpVersionMapping instead, since it already is aware of its Component and Version?
- Even better, why not also offer an API to add a mapping directly to a bundle?
I'm aware that a CmpVersionMapping doesn't have a reference to a bundle; the difference between that and the BundleContent seems to be that a CmpVersionMapping is associated to a Project, Component, and Version--whereas a BundleContent is associated to a Bundle, Component, and Version.
So, what if we had this API method instead?
Or better, these as well?
It is basically what I've added in my own code to wrap the API, it makes it much easier to work with it. Then I can just do this:
- Create the Versioned Bundle
- Create a Versioned Component, or get existing
- Associate a Versioned Component to the Bundle