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

Add user to project area

I'm trying to add a user to a project area using the plain java the code I've been trying to use is:
 IContributorManager contribService= teamRepository.contributorManager();

IContributor[] c = new IContributor[1];
c[0] = contribService.fetchContributorByUserId("userID", null);

if(c == null){
System.out.println("User not found");
}

ProjectAreaWorkingCopy copy = (ProjectAreaWorkingCopy) projectArea.getWorkingCopy();

copy.addMembers(c);

copy.save(null);


but I can't cast from projectArea.getWorkingCopy to ProjectAreaWorkingCopy, tryint to do it straight to the process area gives an immutable property exception.

An help with this would be greatly appreciated, cheers.

0 votes



7 answers

Permanent link
Ok, I've figured out how to add a user to a project area using:
 IContributorManager contribService= teamRepository.contributorManager();

IContributor[] c = new IContributor[1];
c[0] = contribService.fetchContributorByUserId("johndoe@uk.ibm.com", null);

ProjectAreaWorkingCopy wc = new ProjectAreaWorkingCopy(projectArea);
wc.addMembers(c);

wc.save(null);

Now I want to be able to set the user's role. So set their role to be team member (the other possible roles are scrum master, product owner and stakeholder, there is also a default which is the currently selected)

Any ideas? cheers.

0 votes


Permanent link
Why do you want to add user or assign roles to user by using java API? We don't have public java API for those operations. Normally, you should use UI to add user or assign roles.

0 votes


Permanent link
Why do you want to add user or assign roles to user by using java API? We don't have public java API for those operations. Normally, you should use UI to add user or assign roles.


I'm part of a team migrating a company's defects, test cases, test scripts ect from HP quality center to the rational portfolio, as part of that all their users will need to be added to the projects and assigned specific roles.
This will take a lot of time to do manually so I was asked if I could figure out how to do it programatically, I've figured out how to add the users are you saying its impossible to set their roles in this way at the moment?

0 votes


Permanent link
Why do you want to add user or assign roles to user by using java API? We don't have public java API for those operations. Normally, you should use UI to add user or assign roles.


I'm part of a team migrating a company's defects, test cases, test scripts ect from HP quality center to the rational portfolio, as part of that all their users will need to be added to the projects and assigned specific roles.
This will take a lot of time to do manually so I was asked if I could figure out how to do it programatically, I've figured out how to add the users are you saying its impossible to set their roles in this way at the moment?


Assuming you are migrating to 3.0.1, to give a second thought about the process of adding users, there is a way where users can register themselves. You can take a look at these two links.

http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.jazz.repository.web.admin.doc/topics/t_users_self_register.html

http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.jazz.repository.web.admin.doc/topics/tmanagedefaultlicense.html

0 votes


Permanent link
This functionality is requested in work item 90321. Please add a
comment to that work item to indicate your interest/support.

Note that the mechanisms described below in an earlier response allows a
user to register themselves as a valid user of the repository, and
allows them to be auto-assigned a given type of (repository-defined)
license type. But it doesn't let them automatically add themselves as a
member of a given project area with a specified role. It is unlikely
that you will want to allow an arbitrary user to do this for themselves,
so "auto-assign is unlikely to be appropriate.

Cheers,
Geoff

On 9/11/2011 11:23 PM, indradrib wrote:
lc00141wrote:
Why do you want to add user or assign
roles to user by using java API? We don't have public java API for
those operations. Normally, you should use UI to add user or assign
roles.Why do you want to add user or assign roles to user by using
java API? We don't have public java API for those operations.
Normally, you should use UI to add user or assign
roles.


I'm part of a team migrating a company's defects, test cases, test
scripts ect from HP quality center to the rational portfolio, as part
of that all their users will need to be added to the projects and
assigned specific roles.
This will take a lot of time to do manually so I was asked if I could
figure out how to do it programatically, I've figured out how to add
the users are you saying its impossible to set their roles in this
way at the moment?



Assuming you are migrating to 3.0.1, to give a second thought about
the process of adding users, there is a way where users can register
themselves. You can take a look at these two links.

http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.jazz.repository.web.admin.doc/topics/t_users_self_register.html


http://publib.boulder.ibm.com/infocenter/clmhelp/v3r0m1/topic/com.ibm.jazz.repository.web.admin.doc/topics/tmanagedefaultlicense.html

0 votes


Permanent link
Ok cheers for your help.

0 votes


Permanent link
Why do you want to add user or assign roles to user by using java API? We don't have public java API for those operations. Normally, you should use UI to add user or assign roles.


I'm part of a team migrating a company's defects, test cases, test scripts ect from HP quality center to the rational portfolio, as part of that all their users will need to be added to the projects and assigned specific roles.
This will take a lot of time to do manually so I was asked if I could figure out how to do it programatically, I've figured out how to add the users are you saying its impossible to set their roles in this way at the moment?

There is a document about bulk manipulation of process memberships you might be interested in: https://jazz.net/library/article/633

0 votes

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,938

Question asked: Sep 05 '11, 9:38 a.m.

Question was seen: 6,623 times

Last updated: Sep 05 '11, 9:38 a.m.

Related questions
Confirmation Cancel Confirm