Create a Release with plain java API
Hello,
I want to create a Release using plain Java API. This is the code that I'm using:
IWorkItemCommon common =(IWorkItemCommon) teamRepository.getClientLibrary(IWorkItemCommon.class);
IDeliverable release=common.createDeliverable(projectArea,releaseName,MONITOR);
release.setCreationDate(new Timestamp(System.currentTimeMillis()));
release.setIteration(iteration);
release.setArchived(false);
release.setArtifact(artifact);
return common.saveDeliverable(release,MONITOR);
But the problem is that I don't have a method for setting the Global Configuration for the release. There is another way to do it?
Thank you!
4 answers
I don't know the answer to your EWM API question. However, I want to point out that the relationships between EWM releases and global configurations changed in 7.0.2, and again in 7.0.2+ (aka iFix008a or later).
In 7.0.2 (no Ifixes), an EWM Release no longer has a relationship to a global configuration. This was removed from the web UI, and that data is no longer used for either navigating from work items to versioned artifacts like requirements or test cases, or for querying back-links to show incoming links from work items to requirements in DOORS Next, or test artifacts in ETM. Instead, the GCM application supports creating release links from a global configuration to zero, one, or many EWM releases.
In 7.0.2 iFix008a and later, the capability to have an EWM release be associated with a maximum of one global configuration was reinstated. This may be used for navigating links from a work item to a versioned artifact such as a requirement or test case. However, it is not used for querying back-links to show incoming links from work items to requirements in DOORS Next, or test artifacts in ETM. What this means is that if you add a link to a global configuration from an EWM release, you should probably also update that global configuration to add a link to that EWM release. If you don't, you could have an asymetric situation in which link navigate from EWM works, but the incoming link from that work item is not displayed in DOORS Next or ETM.
The New and Noteworthy mentions:
You can now associate multiple global configurations to a release. The mapping between a global configuration and a release is managed in the Global Configuration Management application. You can also create or modify reports against a configuration-scoped Report Builder data source to see release-specific work item relationships with versioned artifacts.
So I assume that you can not use the EWM Plain Java API for that step.
Comments
showing 5 of 8
show 3 more comments
I struggle with why we are still discussing this in the context of RTC. If one would take 5 minutes of time to look into how releases are related to global configuration, one can see that that relationship is not created or managed in EWM/RTC but in the Global configuration management tool by creating a link to the release object. At least that is my conclusion since I looked into this.
The discussion should be if there is a public API to create that link. It makes no sense to look into all API options for EWM to create releases. It is not managing that information.
Wen talking about "Use cases" or "Requirements" for automation it is key to understand how the UI and the tools behind do this, before asking for APIs.
Comments
Hello Malina,
the solution is pretty obvious:
ILinkManager linkManager = (ILinkManager) teamRepository.getClientLibrary(ILinkManager.class); String configurationURI = "https://jazz.server.net/gc/configuration/256"; IReference source = IReferenceFactory.INSTANCE.createReferenceToItem(release); IReference target = (IReference) IReferenceFactory.INSTANCE.createReferenceFromURI(URI.create(configurationURI)); ILink link = linkManager.createLink(WorkItemLinkTypes.CONTRIBUTES_TO_CONFIGURATION, source, target); linkManager.saveLink(link, monitor);
BR, Stefan