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

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

 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

0 votes

Comments

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

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?

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

1 vote

Comments

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

1 vote

Comments

 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

  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?

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 vote

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.

1 vote


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

0 votes

Comments

  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

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.

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

0 votes

Comments

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
   
@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;
    }

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
× 12,019

Question asked: Sep 14 '15, 7:57 a.m.

Question was seen: 3,679 times

Last updated: Dec 09 '15, 5:38 a.m.

Confirmation Cancel Confirm