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

Error while associating workitem category to teamarea using Java API

 I could create WorkItem categories but getting an error while associating it to the teamarea.
Getting error in the line createcategory.getAssociatedTeamAreas().add(newTAHandle). I am not getting how to return a boolean object of ITeamAreaHandle inside add method. Getting the compilation error : java.lang.UnsupportedOperationException 

Please help. Below is the related code.

IWorkItemClient wservice = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
ICategory createcategory = wservice.createCategory(area, categoryName, null);
wservice.saveCategory(createcat, null);

 if (!teamArea.equals("NULL")){
              List teamAreas = area.getTeamAreas();
              List <TeamAreaHandle> teamlist = teamAreas;
              ITeamAreaHandle newTAHandle = findTeamAreaByName(teamlist,teamAreaName,monitor);
                       
         createcategory.getAssociatedTeamAreas().add(newTAHandle);
     }

//Method findTeamAreaByName

private static ITeamAreaHandle findTeamAreaByName (List<TeamAreaHandle> teamlist, String teamAreaID, IProgressMonitor monitor) throws TeamRepositoryException {
    for (ITeamAreaHandle teamAreaHandle  :  teamlist) {
    ITeamArea teamArea = (ITeamArea)teamRepository.itemManager().fetchCompleteItem(teamAreaHandle,ItemManager.DEFAULT,monitor);
    if (teamAreaID.equals(teamArea.getName())) {
    return teamAreaHandle;
    }
    }
    return null;
    }

0 votes

Comments

 Please reply


Be the first one to answer this question!

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,952

Question asked: Jun 25 '13, 3:05 p.m.

Question was seen: 3,196 times

Last updated: Jun 26 '13, 2:39 a.m.

Confirmation Cancel Confirm