It's all about the answers!

Ask a question

Any Idea to fetch the Plans from IBM RTC Project area Using Plain Java API? IMP


ramesh m (13310) | asked Sep 14 '15, 7:57 a.m.
 Dear All,
           Please help me to fetch the Plans from IBM RTC using only Plain Java API. Not SDK. this is urgent requirement in My Project. Exports in RTC please help me.

Regards,
Ramesh

Comments
ramesh m commented Sep 14 '15, 9:24 a.m.

did any one done this type of requirement earlier Please provide the sample code. 


Ralph Schoon commented Sep 14 '15, 9:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

What does fetch mean? What is the purpose? You want to be nore detailed with your question. See: How should I ask a question in the Forum if I want to receive useful answers?


ramesh m commented Sep 14 '15, 9:54 a.m.

 Ralph,

         In my Project there is a requirement to display the all the plans available in the Project area, Currently I am able to connect to the Ibm RTC using Plain Java API and able to fetching the all the work items and states.
 So Like wise I want to get all the Plans are Created for that Project. Hope I am Clear Now. 

Note: Using Plain Java API . Am I able to achieve this. Please respond.

Regards,
Ramesh

Accepted answer


permanent link
Miguel Tomico (5001323) | answered Sep 14 '15, 12:43 p.m.
I'm afraid RTC does not publish a public API for Plans management.
There are a couple of enhancement requests around it. For example:
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=228742

Retrieving all plans from a Project Area using internal API must not be straight-forward. No one has posted sample code before for a reason, I guess.

Said that, if you still want to try, here's some code someone posted to retrieve IIterationPlanService using the Java Client API:
IIterationPlanService planService = (IIterationPlanService)((IClientLibraryContext) repo).getServiceInterface(IIterationPlanService.class);

Alternatively, depending on what you are trying to accomplish, there might be other alternatives.
If all you need is to list the Plans, BIRT will serve your purpose well. Browse the table com.ibm.team.apt.IterationPlanRecord under the LIVE_SNAPSHOT datasource.
Ralph Schoon selected this answer as the correct answer

Comments
ramesh m commented Sep 15 '15, 5:41 a.m.

  Hi Miguel,

       from the IIterationPlanService  how can I get IterationPlanRecord ? 
I am able to load the IIterationPlanService  with help of given code.

4 other answers



permanent link
Miguel Tomico (5001323) | answered Sep 15 '15, 6:19 a.m.
Cannot help you with that. It's a very dark area you are getting into. As there is no public API, only a jazz developer will have the knowledge to run automations around Plans safely.

As I mentioned, there might be alternatives, but
As Ralph mentioned, you will have to provide more detail:

  • Clearly describe what you do or want to do, and what the problem/question is 
  • Explain why you want to do this and what you want to achieve with it - often problems are not problems in the tool, but knowing how to achieve certain goals; knowing what the intent is often directs to completely different answers 

Comments
ramesh m commented Sep 15 '15, 12:36 p.m.

 I have written a standalone Java Program , From that I am Trying to Connect to IBM RTC using Plain Java API. I am able to Login and able to fetch the Work items. 

Now My questions is I need to get the all the Plans created in that Project Area. Using Java API. am I clear Now?

Regards,
Ramesh


ramesh m commented Sep 15 '15, 12:37 p.m.

  I have written a standalone Java Program , From that I am Trying to Connect to IBM RTC using Plain Java API. I am able to Login and able to fetch the Work items. 

Now My questions is I need to get the all the Plans created in that Project Area. Using Java API. am I clear Now?


1
Miguel Tomico commented Sep 16 '15, 4:05 a.m.

No, I'm afraid you are not clear. You are simply repeating a suggested solution to... what problem?

We would need to know the high-level user requirement to advise the best solution.
This article explains the difference between requirement and solution.

So,
What is that standalone Java program for? What's the overall user need behind it? Why do you need it?
The optimal solution might not be using the Java API, but using BIRT, looping through Work Items instead of Plans, or any other solution you didn't even know that existed.


1
Ralph Schoon commented Sep 16 '15, 4:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

And again, there is no Plan API published in the Plain Java Client Libraries.
All plan API has a name like com.ibm.team.apt.* and you can see that those JAR's are not there.
You would have to use the RTC Eclipse Client SDK and you would have to look at the code yourself to understand how the classes could potentially be used. All the API will be unsupported internal API.


permanent link
Ralph Schoon (63.1k33646) | answered Sep 14 '15, 9:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please note that the planning API is not published in the Plain Java Client Libraries.
This is what I know about that API:

Creating Plans With the Plain Java Client API

It is often a great idea to use a search engine to find other examples.

Comments
ramesh m commented Sep 14 '15, 10:15 a.m. | edited Nov 16 '15, 9:21 a.m.

  Hi All,


       I found some sample code to get the Plans from IBm RTC. for that below two dependencies copied from SDK to my Project classpath.

import com.ibm.team.apt.common.IIterationPlanRecord;
import com.ibm.team.apt.common.IIterationPlanRecordHandle;

IterationPlanClient planClient = (IterationPlanClient) teamRepository.getClientLibrary(IterationPlanClient.class);

but I am getting null as planClient.  Please help me on this.

  java.util.List<IIterationPlanRecordHandle> handles= planClient .fetchAllIterationPlans(ItemProfile.createFullProfile(IIterationPlanRecord.ITEM_TYPE), monitor);

 java.util.List<IIterationPlanRecord> plans= planClient .getItemManager().fetchCompleteItems(handles, IItemManager.DEFAULT, monitor);
      
Iterator<IIterationPlanRecord> iter= plans.iterator();
while(iter.hasNext()) {
IIterationPlanRecord plan= iter.next();
        System.out.println(plan.getName() +"::::"+plan.getPlanType());
}

Regards,
Ramesh M


Ralph Schoon commented Sep 14 '15, 11:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

IterationPlanClient  is loaded in a different way, if you look into the SDK. I have just looked into that, but I don't have the time to play around with this.


ramesh m commented Sep 14 '15, 11:34 a.m.

Kindly Spend your valuable time on this and let me know the ways to Load the IterationPlanClient. This is urgent requirement. 


Awaiting for your reply.

Regards,
Ramesh M


permanent link
Umeshkumar Rajani (16512) | answered Dec 09 '15, 4:23 a.m.
edited Dec 09 '15, 4:27 a.m.
Hi,

Did anybody get plan using RTC SDK?, Please help me on this. I have loaded all the jar from SDK to my project, those are around 1300. but I don't know I'm not able resolve dependency. says methods are not visible. So should I change it in the respective class method's & field's access specifier?

@Ralph Schoon, @ramesh m : please help me if you get any solution around this.
 
Thanks,
Umesh

Comments
Ralph Schoon commented Dec 09 '15, 4:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The plan API is not published in the Plain Java Client Libraries and some API is only available in the SDK. I have no solution and not much more to say.


permanent link
ramesh m (13310) | answered Dec 09 '15, 5:38 a.m.
   
@Umeshkumar Rajani , Please find the sample code from below. you will get all the sprints in that project area.
 IDevelopmentLine line = null;
ArrayList<String> list = new ArrayList<String>();
ArrayList<ArrayList<String>> listall = new ArrayList<ArrayList<String>>();
IDevelopmentLineHandle[] developmentHandles = projectArea.getDevelopmentLines();
developmentLines = iTeamRepository.itemManager().fetchCompleteItems(Arrays.asList(developmentHandles),IItemManager.DEFAULT, null);
for (Iterator<Iteration> e = developmentLines.iterator(); e.hasNext();) {
         line = (IDevelopmentLine) e.next();
         IIterationHandle[] iterationHandles = line.getIterations();
         list = PlannedForRecursive(iterationHandles);
         if (list != null)
         listall.add(list);
         }

public ArrayList<String> PlannedForRecursive(IIterationHandle[] iterationHandles) {
        ArrayList<String> interation_name = new ArrayList<String>();
        List<Iteration> iterationlines = null;
        IIteration iteration = null;
        ArrayList<String> templist = null;
try {
if (iterationHandles != null) {
iterationlines = iTeamRepository.itemManager().fetchCompleteItems(Arrays.asList(iterationHandles),IItemManager.DEFAULT, null);
for (Iterator<Iteration> e1 = iterationlines.iterator(); e1.hasNext();) {
iteration = e1.next();
if (iteration != null && iteration.getName() != null && !iteration.isArchived())
interation_name.add(iteration.getName());
if (iteration.getChildren() != null) {
templist = PlannedForRecursive(iteration.getChildren());
}
if (templist != null) {
for (String sprintName : templist) {
if (sprintName != null) {
                       interation_name.add(sprintName);
                       LOG.info("planned Sprints:"+sprintName);
}
}
}
}
}
   } catch (TeamRepositoryException e) {
    e.printStackTrace();
   }
        return interation_name;
    }

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.