Teams role API
EclipseTalk . (327●3●60●61)
| asked Mar 26 '10, 11:04 a.m.
retagged Jan 04 '13, 7:05 a.m. by Morten Madsen (305●31●49)
Hi,
There is an api to set contributor roles for team. However since it is possible to have a project without a team, how can I set programmatically roles for a contributor at the project level? Thanks in advance for your help
|
19 answers
Thanks for reply -
However you don't set a given role to a contributor at the project level - The code snippet adds a contributor (with a dev license) to a project and retrieve a given project role. What I need is to be able to add a role at the project level for an existing contributor to the project. You do get the role for the project via
which is fine but you never assign roles to the contributor. Am I missing something? Thanks |
in the code here is add the role to the user
workingCopy.addMembers(contributors); workingCopy.setRoleCast(contributors, roles); workingCopy.save(MONITOR); readding an existing user does no affect the user |
Thank you, however note that the setRoleCast is deprecated and therefore shoudln't be used....
|
public void setRoleCast(IContributorHandle contributor, IRole[] roleCast) {
ITeamWorkingCopy team = getTeam(); if (team != null) { team.setRoleCast(contributor, roleCast); } } |
I retrieve
ProjectAreaWorkingCopy workingCopy = (ProjectAreaWorkingCopy)manager.getWorkingCopy(project); this class extends to ProcessAreaWorkingCopy public class ProjectAreaWorkingCopy extends ProcessAreaWorkingCopy implements IProjectAreaWorkingCopy In ProcessAreaWorkingCopy setRoleCast retreives the team and sets the role. It is not deprecated. |
This is what I was asking at the beginning of this thread...
One can set the role at the team level via
but it cannot be set at the project level - ie the API Thanks |
Hi, I am trying to achieve similar scenario and after reading the full
thread I have following questions: 1.- IProcessAreaWorkingCopy is going to be private but ProjectAreaWorkingCopy won't? 2.- Which method is deprecated? I have compiled the code against Plain Java Classes from RTC 3.0M6 and nothing has been marked as deprecated. 3.- Why did you say it is not working with Project Areas? I used the commented code with a Project Area and it worked fine. URI uri= URI.create("Testing Project Area".replaceAll(" ", "%20")); IProjectArea pa = (IProjectArea)service.findProcessArea(uri, null, monitor); pa = (IProjectArea)service.getMutableCopy(pa); .... .... .... IWorkingCopyManager manager = service.getWorkingCopyManager(); manager.connect(pa); ProjectAreaWorkingCopy workingCopy = (ProjectAreaWorkingCopy)manager.getWorkingCopy(pa); .... .... workingCopy.addMembers(members); workingCopy.setRoleCast(members, roles); workingCopy.save(monitor); manager.disconnect(pa); Thanks, Chemi. |
Hello guys,
do we have any news on this regard? For Beta1 API still looks the same for these classes, although I guess that the not-supported consideration is still valid, right? Thanks! Regards, Jorge. |
Hello Guys,
Everything speaks about adding a role to users, how to do we add multiple roles to a single users. Can anyone help ? Regards, Raj |
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.