How to automate tam area creation in a project in RTC ?
Hi Team,
We are using Rational CLM 6.0.1 . We have created couple of project areas in RTC. We are having a requirement to create "n" number of teams in the project areas and to add users to each and every team area.
Is there any automate process available to create team areas and users to the team areas in RTC ?
Thanks in Advance,
Swapna Das
Accepted answer
Hi,
it is possible to use the API's especially the Plain Java Client Library to create team areas and assign users. There is a Snippet that ships with the plain java client libraries that creates a project area ans also a team area, snippet3.java I believe.
I am pretty sure this has also discussed here in the forum and there is example code but I was not able to find a lot using https://www.google.com/search?q=ITeamArea+fite:jazz.net.
Here some example code
it is possible to use the API's especially the Plain Java Client Library to create team areas and assign users. There is a Snippet that ships with the plain java client libraries that creates a project area ans also a team area, snippet3.java I believe.
I am pretty sure this has also discussed here in the forum and there is example code but I was not able to find a lot using https://www.google.com/search?q=ITeamArea+fite:jazz.net.
Here some example code
public static ITeamArea createTeamArea(String teamAreaName, IProjectArea projectArea, IProcessItemService itemService, IProgressMonitor monitor) throws TeamRepositoryException { ITeamArea teamArea = itemService.createTeamArea(); teamArea.setName(teamAreaName); //teamArea.addMember(teamRepository.loggedInContributor()); teamArea.setProjectArea(projectArea); projectArea = (IProjectArea) itemService.getMutableCopy(projectArea); projectArea.getTeamAreaHierarchy().addRoot(teamArea, projectArea.getDevelopmentLines()[0]); IProcessItem[] items = itemService.save(new IProcessItem[] { projectArea, teamArea }, monitor); teamArea = (ITeamArea) items[1]; IProcessAreaWorkingCopy areaWc = (IProcessAreaWorkingCopy) itemService .getWorkingCopyManager().createPrivateWorkingCopy(teamArea); areaWc.save(monitor); return teamArea; } public static void addMemberToProcessArea(IContributor user, IRole role, IProcessArea processArea, IProcessItemService itemService, IProgressMonitor monitor) throws TeamRepositoryException { IProcessAreaWorkingCopy areaWc = (IProcessAreaWorkingCopy) itemService .getWorkingCopyManager().createPrivateWorkingCopy( processArea); areaWc.getTeam().addContributorsSettingRoleCast( new IContributor[] { user }, new IRole[] { role }); areaWc.save(monitor); }
Comments
Thanks Ralph for your quick response.
By using the code snippet , I am able to create "n" number of team areas under my project.
Can you please help me how to add a list of users to the newly created team areas with their respective roles ?
Swapna
This is really scary. You did not recognize the method that I pasted as well?
addMemberToProcessArea