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

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

0 votes


Accepted answer

Permanent link
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


	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);
	}

swapna das selected this answer as the correct answer

0 votes

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

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

Question asked: Aug 08 '16, 9:34 a.m.

Question was seen: 2,126 times

Last updated: Aug 11 '16, 7:00 a.m.

Confirmation Cancel Confirm