It's all about the answers!

Ask a question

[RTC] Creation of RTC Release Programmatically


Chandan M B (1133473) | asked Feb 10 '22, 2:44 p.m.

 Hi,


Is there a possibility to create a release and assign the iteration to the release via Java API ?
If not, what could be other possibility to achieve this solution

Regards,
Chandan

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Feb 11 '22, 2:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Feb 11 '22, 2:32 a.m.

A release in the context of RTC is an  com.ibm.team.workitem.common.model.IDeliverable and can be created using com.ibm.team.workitem.common.IWorkItemCommon.createDeliverable(IProjectAreaHandle, String, IProgressMonitor). The interface IDeliverable has, amongst others, a method to set an iteration.

Ralph Schoon selected this answer as the correct answer

Comments
Chandan M B commented Feb 11 '22, 2:35 a.m.

Thanks Ralph. I am posting my code in new comment.

One other answer



permanent link
Chandan M B (1133473) | answered Feb 11 '22, 2:36 a.m.

IDeliverable release = (IDeliverable) IDeliverable.ITEM_TYPE.createItem();
        release.setArchived(false);
        release.setName(releaseName);
        release.setFiltered(false);
        release.setArtifact(newIteration.getItemHandle());

        release.setIteration((IIterationHandle) newIteration.getItemHandle());

fWorkItemCommon = (IWorkItemCommon) fTeamRepository.getClientLibrary(IWorkItemCommon.class);
fWorkItemClient.saveDeliverable(release, null);

This code is getting failed.


Comments
Ralph Schoon commented Feb 11 '22, 3:03 a.m. | edited Feb 11 '22, 3:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Several issues:  

  1. "This code is getting failed." is not an error description that makes me willing to spend another second on the code. It is totally unprofessional. I am not free services and can decide where I help on the forum. I am not going to rebuild your code to see the error message.
  2. That If answers are given the answers are not thoroughly read is discouraging to answer questions. I shared the method to create a deliverable already and it is not the one you use.
  3. I am pretty sure I have mentioned this to you already: set up a development workspace with the SDK following the RTC Extensions Workshop and use the find and navigation capabilities of Eclipse to search the SDK for the usage of the API. That way you can figure out how the API works as soon as you have an idea which class you need to deal with e.g. IDeliverable. This is how I find the answers and is the best way I know to approach the Java APIs.


Chandan M B commented Feb 11 '22, 3:13 a.m.

Sorry for my behaviour for not providing error logs. I will try to analyse bit more.


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

Try using the proposed method to create the deliverable.

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.