how can I programmatically get the team area description
I am writing a report on the Team Areas and I am able to get the team area Name and summary, members and the roles of those members. However, the Description (the multi-line box in the UI) I can't seem to get yet.
//get the team area ITeamArea teamArea = (ITeamArea)rtcm.getRepository().itemManager().fetchCompleteItem(teamAreaHandle,0,null);
//get the teamData from that area ITeamData teamData = teamArea.getTeamData();
//Get the team area name String name = teamArea.getName();
However, here is where I get problems. The summary (the 1-liner)
String summary = teamArea.getDescription().getSummary();
but the multi-line Description field I'm having problems with. It isn't the getDescription() since I use it to get the 1-line summary. Does anyone know how to get the multi-line description??
Susan
//get the team area ITeamArea teamArea = (ITeamArea)rtcm.getRepository().itemManager().fetchCompleteItem(teamAreaHandle,0,null);
//get the teamData from that area ITeamData teamData = teamArea.getTeamData();
//Get the team area name String name = teamArea.getName();
However, here is where I get problems. The summary (the 1-liner)
String summary = teamArea.getDescription().getSummary();
but the multi-line Description field I'm having problems with. It isn't the getDescription() since I use it to get the 1-line summary. Does anyone know how to get the multi-line description??
Susan
Accepted answer
Hi Susan,
please try:
IDescription desc= teamArea.getDescription();
IContent content = desc.getDetails();
String detdescription="";
if (content != null) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
teamRepository.contentManager().retrieveContent(content, stream,null);
try {
detdescription = stream.toString(content.getCharacterEncoding();
} catch (UnsupportedEncodingException exception) {
detdescription = stream.toString();
}
}
please try:
IDescription desc= teamArea.getDescription();
IContent content = desc.getDetails();
String detdescription="";
if (content != null) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
teamRepository.contentManager().retrieveContent(content, stream,null);
try {
detdescription = stream.toString(content.getCharacterEncoding();
} catch (UnsupportedEncodingException exception) {
detdescription = stream.toString();
}
}
Comments
Bingo! Thanks, this works perfectly. Since we rotate "Iteration Lead" role every iteration, we have been requiring the teams to update multiple places: one in RTC to get the right role permissions and one on a wiki for a table. This way, we can have them update RTC and the wiki table for quick information can be generated automatically off a cron job that runs nightly.
Susan
One other answer
In addition to the code Ralph provided (which looks reasonable to me), I would also point you to the "Runtime Report" feature that is currently available in the RTC Eclipse client. If you right click on a project area in the Team Organization view and select Generate Runtime Report, you'll get a zip file with an HTML site containing this kind of info.
If there's something missing from the report, you can open an enhancement request against Jazz Foundation, Process component.
If there's something missing from the report, you can open an enhancement request against Jazz Foundation, Process component.