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

RTC - associate category with Team Area using Plain Java APIs

Trying to associate category with team area using Plain JAVA APIs but it fails with the below error.

2 methods used but both fail with different errors.
Code snippet and the error added. Any hints will be of great help :)

1. Call used: ICategoryObject.getTeamAreas().add(ITeamAreaHandle);

Error : com.ibm.team.repository.common.internal.ImmutablePropertyException

Tried with Category Object too. Same error caused.

2. ICategoryObject.getAsscociatedTeamAreas().add(ITeamAreaHandle);
Error: unmodifiable collection exception for getAsscociatedTeamAreas

0 votes

Comments

  ICategory  category = service.createCategory(project,categoryName,MONITOR);
 ITeamArea team         

category.getAssociatedTeamAreas().add(team);

works for me on a new category, are you trying on an existing category or a new one ?

Sorry I was mistaken I had to do this to make it work
ICategory  category = service.createCategory(project,categoryName,MONITOR);
 ITeamArea team

 ((Category) category).getTeamAreas().add(team);
 ((Category) category).setDefaultTeamArea(team);


1 vote

Thanks K M. We have already tried the 1st option but no success.
 ((Category) category).getTeamAreas().add(team); 
neither for new category created or for an existing category.

Shall try out the 2nd option. Thank you.

regards,
Radha



One answer

Permanent link
Thanks KM. Solution worked for creating new categories and associating with team Area.
For existing Categories, working copy has to be created and then the association as you have described works.
Thanks for the solution.

Regards,
Radha

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

Question asked: Aug 18 '15, 4:50 a.m.

Question was seen: 3,194 times

Last updated: Sep 07 '15, 9:59 a.m.

Confirmation Cancel Confirm