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

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

0 votes



One answer

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

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
× 10,927

Question asked: Jul 20 '11, 7:14 a.m.

Question was seen: 5,424 times

Last updated: Jul 20 '11, 7:14 a.m.

Confirmation Cancel Confirm