Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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!

0 votes



4 answers

Permanent link
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.


0 votes

Comments

Thank you! 


Permanent link

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.

0 votes

Comments

See https://jazz.net/library/article/96597 how this is done and it is not done in EWM. the IDeliverable interface remains unchanged. 

Thank you! 

The cited statements from New and Noteworthy and Work item linking in a global configuration context: Overview are only correct for 7.0.2. In 7.0.2+ the Release-GC mapping table in EWM was reinstated, as David already mentioned.
The question, why IDeliverable has no method for setting the GC, sounds reasonable for me.

From 7.0.2iFix10 Readme:
As a project administrator, you can associate releases with a GC in the Releases page that is used by EWM when the GC for outgoing OSLC links is inferred from work item attribute values. However, you must also specify the inverse association of a GC to a release in GCM to ensure consistent back link filtering of work items from linked OSLC artifacts.

Thank you! 

The question, why IDeliverable has no method for setting the GC, sounds reasonable for me.

Because the GC refers to the deliverable using a link and not the other way around? This allows the EWM API to keep compatible and there is no need for UI changes, except the ability to choose an active configuration.  In addition, it is the developers choice how they implement capabilities.

 I found this questions https://jazz.net/forum/questions/207552/where-is-the-restoslc-api-for-crud-of-rtc-releases  on the forum and it uses another type of implementation and I tried to add a configuration to a release with this and it worked. But I'm wondering if it safe to use it. Do you have any idea?


Thanks!

That is not a supported method and it also does not create a relationship to a global configuration management element. So do not use that aPI.

The question, why IDeliverable has no method for setting the GC, sounds reasonable for me.

The proper answer to this question would have been that a Release doesn't have a GC attribute and therefore also no setGC() method. Releases and GCs are associated via link and the Link API needs to be utilized for defining a GC for a Release.

showing 5 of 8 show 3 more comments

Permanent link

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. 

0 votes

Comments

It's a valid question for 7.0.2+ (aka 7.0.2 iFix008a) and later, when the EWM release to GC link was reinstated.

 I am able to link a release to a global configuration from the GC perspective using the GCM REST API. After I link it, the release is visible only in the global configuration, not in the EWM so I thought that the relationship to be bidirectional, I should link the global configuration also from the EWM. 

David is likely better prepared to answer this, but to my knowledge the GC->Release is only maintained in the Global configuration. You have to select the global configuration in EWM to make it aware of the link (note different behavior across different patches). 


I haven't been able to figure how to  do that in the EWM Eclipse client, I could not find a good documentation. I also do not have the latest patch deployed, but David has answered in breadth and depth what the different behaviors across the patches and release are. 

It would have been desirable not to have to do such drastic changes in a patch, but the users demanded it.

I would suggest to look into the patch situation, to understand if and how global configuration management is enabled in EWM and to find out how it is supposed to work and if it does, then look into automation.

 Also note, even if a connection would be bidirectional, it would be a wrong assumption that the connection would be stored at both ends. Something like a link indexer would be enough. In the EWM case as you have to select the global configuration you want to work with, EWM knows what you want to see and does not even need the opposite direction.

  I am able to link a release to a global configuration from the GC perspective using the GCM REST API. After I link it, the release is visible only in the global configuration, not in the EWM so I thought that the relationship to be bidirectional, I should link the global configuration also from the EWM. 

My understanding is that you link from a global configuration to a release that represents a local configuration in EWM and not the other way around. 


Permanent link
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

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 19

Question asked: Feb 18 '22, 3:16 a.m.

Question was seen: 1,891 times

Last updated: Mar 18 '22, 3:13 a.m.

Confirmation Cancel Confirm