How can i set the value for attribute of type TeamAreaList
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 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
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?