It's all about the answers!

Ask a question

Create a Release with plain java API


Dumitrescu Malina (113) | asked Feb 18 '22, 3:16 a.m.

 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



permanent link
David Honey (1.8k17) | answered Feb 18 '22, 4:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.



Comments
Dumitrescu Malina commented Feb 18 '22, 8:04 a.m.

Thank you! 


permanent link
Ralph Schoon (63.1k33645) | answered Feb 18 '22, 4:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 18 '22, 4:43 a.m.

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
Ralph Schoon commented Feb 18 '22, 6:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Dumitrescu Malina commented Feb 18 '22, 7:54 a.m.

Thank you! 


Stefan Oblinger commented Feb 18 '22, 8:01 a.m.
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.

Dumitrescu Malina commented Feb 18 '22, 8:04 a.m.

Thank you! 


Ralph Schoon commented Feb 18 '22, 8:35 a.m. | edited Feb 18 '22, 8:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.


Dumitrescu Malina commented Feb 24 '22, 10:12 a.m.

 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!


Ralph Schoon commented Feb 24 '22, 10:18 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Stefan Oblinger commented Mar 16 '22, 2:09 a.m.
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
Ralph Schoon (63.1k33645) | answered Feb 24 '22, 10:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 24 '22, 10:28 a.m.

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
David Honey commented Feb 24 '22, 10:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Dumitrescu Malina commented Feb 24 '22, 10:38 a.m.

 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. 


Ralph Schoon commented Feb 24 '22, 10:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Ralph Schoon commented Feb 24 '22, 10:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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.


Ralph Schoon commented Feb 24 '22, 11:01 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  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
Stefan Oblinger (170213) | answered Mar 15 '22, 4:57 p.m.
edited Mar 16 '22, 1:55 a.m.
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

Your answer


Register or 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.