Is there a way to get the work allocation,Team area information of a team member when adding a he/she to the project/Team?
Is there a way to get all the information (already allocated project area, Team areas, work allocation to each team area) about the team member when a adding a team member to project/team Area ?
Is there any way wherein I can develop a plugin which gets invoked when I add a member to the project/team so that I can modify the work allocation of that team member to all the team areas he is allocated to?
Please let me know can I achieve this by plugin/via MPT Customization/any other means?
One answer
There is (internal) client API to get that information. The API is accessible using the same fundamental API described here: http://rsjazz.wordpress.com/2014/07/22/manage-scheduled-absences-using-the-plainjava-client-libraries/
Some experimental code I am working on:
Some experimental code I am working on:
final IResourcePlanningClient resourcePlanning = (IResourcePlanningClient) teamRepository
.getClientLibrary(IResourcePlanningClient.class);
ResourcePlanningManager resourcePlanningManager = resourcePlanning.getResourcePlanningManager();
IProcessItemService processItemService = (IProcessItemService) teamRepository
.getClientLibrary(IProcessItemService.class);
List processAreasOfUser= processItemService.findProcessAreas(user, null, IProcessClientService.ALL_PROPERTIES , monitor);
IContributorInfo info = resourcePlanningManager.getContributorInfo(user, true, monitor);
for (Iterator iterator = processAreasOfUser.iterator(); iterator
.hasNext();) {
IProcessArea area = (IProcessArea) iterator.next();
IDevelopmentLine devLine = processItemService.getDevelopmentLine(area, monitor);
// as percantage e.g. 20 for 20%
int workassignment = info.getWorkAssignment(user, area, devLine );
System.out.println("WorkAssignment: " + area.getName() + " " + devLine.getName() + " : " + workassignment);
}
ItemCollection<iworkresourcedetails> details = info.getWorkDetails(user);
for (Iterator det = details.iterator(); det
.hasNext();) {
IWorkResourceDetails workDetails = (IWorkResourceDetails) det.next();
printWorkDetail(teamRepository,workDetails);
}
in the IWorkResourceDetails the owner is the team/project area.Start and end date are either spefific dates or Jan 1 2000 (start) and Jan1 3000 for unspecified. getAssignment() is the percentage and getDevelopment line, the development line.