It's all about the answers!

Ask a question

How can i set the value for attribute of type TeamAreaList


Amol Ramteke (133) | asked Jul 20 '11, 7:14 a.m.
How can i set the value for attribute of type TeamAreaList
i have written a code but geting a null pointer exception on fetchItem method.

List<ITeamAreaHandle> listTeams = projectArea.getTeamAreaHierarchy().getTeamAreas();



listTeamAreas = WorkItemInitialization.readFile(fFilePath);

ITeamAreaHandle teamAreaHandle1 =null;
int size = listTeamAreas.size();
if(listTeamAreas!=null && !listTeamAreas.isEmpty()){
Team crbTeam = null;
List<ITeamArea> cachedTeamArea = new ArrayList<ITeamArea>();
List<Team> teams = null;
for (Team team : listTeamAreas){
for(ITeamAreaHandle team1: listTeams){
// teamArea = WorkItemInitialization.fetchTeamArea(team, projectArea, monitor,cachedTeamArea);
// teamArea = (ITeamArea) service.getMutableCopy(teamArea);
ITeamArea teamArea = fetchItem(team1, monitor);
if(teamArea.getName().equalsIgnoreCase(team.getTeamName())){
cachedTeamArea.add(teamArea);
}
}
}
workItem.setValue(ChangeTechnicalreviewboardAttribute,cachedTeamArea);

One answer



permanent link
Thomas Yu (45183) | answered Jul 24 '11, 11:25 p.m.
How can i set the value for attribute of type TeamAreaList
i have written a code but geting a null pointer exception on fetchItem method.

List<ITeamAreaHandle> listTeams = projectArea.getTeamAreaHierarchy().getTeamAreas();



listTeamAreas = WorkItemInitialization.readFile(fFilePath);

ITeamAreaHandle teamAreaHandle1 =null;
int size = listTeamAreas.size();
if(listTeamAreas!=null && !listTeamAreas.isEmpty()){
Team crbTeam = null;
List<ITeamArea> cachedTeamArea = new ArrayList<ITeamArea>();
List<Team> teams = null;
for (Team team : listTeamAreas){
for(ITeamAreaHandle team1: listTeams){
// teamArea = WorkItemInitialization.fetchTeamArea(team, projectArea, monitor,cachedTeamArea);
// teamArea = (ITeamArea) service.getMutableCopy(teamArea);
ITeamArea teamArea = fetchItem(team1, monitor);
if(teamArea.getName().equalsIgnoreCase(team.getTeamName())){
cachedTeamArea.add(teamArea);
}
}
}
workItem.setValue(ChangeTechnicalreviewboardAttribute,cachedTeamArea);


I am wonderring whether team1 is a valid ITeamAreaHandle, have you debugged to see its value?

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.