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

Unable to create project Area using customized process template using RTC JAVA API

 Hi Team,
   I want to create a Project Area using our customized process template using RTC API.
I am able to  create the project area using OOTB templates but it fails to create the project area while I used my customized process templates .By using RTC API  I am  able to fetch the all the process templates (OOTB + Customized).
And I want to add 'n' number of users to the project and team area programmatically. I am able to add only one user with whose id I logged into the tool.
Please help me on this.

Thanks,
Swapna Das

0 votes



2 answers

Permanent link
I would suggest to look at snippet3 in the plain Java client libraries for the basics. In addition see https://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/

I assume that the project area needs to be initialized and saved with the user that runs the script being part of the administrators, before additional users can be added, but I could be wrong. There are also unit tests shipped with the SDK where you can have a look, which add multiple users.

If you need more help, come up with a decent description of the error you see.

0 votes

Comments

Hi Ralph,  

   By referring snippet3 , I am able to add only one user with whose id I logged into the tool to the newly created project Area. But I want to add "n" number of users to the team area at a time . can you please help me on the same ?

Thanks,

Swapna Das 

 Note that some of the parameters are arrays so you could add more than one object.


Permanent link
 I have always found that in programming, if you can do it for one object, you can do it for many.

Here the full code for a small utility method that adds one user with a role to a process area. By using this repeatedly you should succeed.

/**
* Adds a user as a member with a specific role to a process area
* @param user
* @param role
* @param processArea
* @param itemService
* @param monitor
* @throws TeamRepositoryException
*/
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);
}

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

Question asked: Nov 12 '15, 1:18 a.m.

Question was seen: 2,708 times

Last updated: May 09 '16, 5:16 a.m.

Confirmation Cancel Confirm