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
|
Accepted answer
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
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:
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
And again, there is no Plan API published in the Plain Java Client Libraries.
|
Ralph Schoon (63.4k●3●36●46)
| 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 APIIt is often a great idea to use a search engine to find other examples.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
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
|
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 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.
|
@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
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.
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,