It's all about the answers!

Ask a question

Setting associated team area for category


m sawires (1462268) | asked Mar 22 '10, 5:15 p.m.
Hello,
I need to create programmatically a workitem with a new category and assign a team area to that category.
I can create the workitem and the category fine but there is no setters for assigning team areas. There are only getters:
category.getDefaultTeamArea(); 

category.getAssociatedTeamAreas();

How can I set the team area to the category?
Thanks in advance for your help.

4 answers



permanent link
m sawires (1462268) | answered Mar 24 '10, 8:41 a.m.
Perfect. Thanks a lot.

permanent link
Patrick Streule (4.9k21) | answered Mar 24 '10, 5:23 a.m.
JAZZ DEVELOPER
Thanks for the reply -
However I can only set the default team area and not the associated
ones using the class Category and when I
do the following I get an exception upon save:
internalCategory.setDefaultTeamArea(defaultTeamArea);

getWorkItemCommon().saveCategory(category,
monitor);

Exception:
com.ibm.team.repository.common.TeamRepositoryException:
Default team area not in team area list

It seems that the default team has to be in the team area list first.
Thanks

You can set the associated ones using:
((Category) category).getTeamAreas().add(teamArea);

--
Regards,
Patrick
Jazz Work Item Team

permanent link
m sawires (1462268) | answered Mar 23 '10, 9:12 a.m.
Thanks for the reply -
However I can only set the default team area and not the associated ones using the class Category and when I do the following I get an exception upon save:
internalCategory.setDefaultTeamArea(defaultTeamArea);		            	

getWorkItemCommon().saveCategory(category, monitor);


Exception:
com.ibm.team.repository.common.TeamRepositoryException: Default team area not in team area list

It seems that the default team has to be in the team area list first.
Thanks

permanent link
Patrick Streule (4.9k21) | answered Mar 23 '10, 4:49 a.m.
JAZZ DEVELOPER
Hello,
I need to create programmatically a workitem with a new category and
assign a team area to that category.
I can create the workitem and the category fine but there is no
setters for assigning team areas. There are only getters:
category.getDefaultTeamArea();
category.getAssociatedTeamAreas();
How can I set the team area to the category?
Thanks in advance for your help.

The API to associate categories with team areas is internal.

If you need it anyway, cast the ICategory to the internal Category
interface and use e.g. category.setDefaultTeamArea(...).

--
Regards,
Patrick
Jazz Work Item Team

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.