Setting associated team area for category
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:
How can I set the team area to the category?
Thanks in advance for your help.
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
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
Thanks for the reply -
However I can only set the default team area and not the associated ones using the classCategory and when I do the following I get an exception upon save:
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
However I can only set the default team area and not the associated ones using the class
internalCategory.setDefaultTeamArea(defaultTeamArea);
getWorkItemCommon().saveCategory(category, monitor);
Exception:
It seems that the default team has to be in the team area list first.
Thanks
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