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

How to check the Work Allocation is set to default allocation?

Hello Team,

I am trying to fetch the work allocation details of a user from RTC.

I found some solutions to get the details of work allocation as below,

 // Get the resource planning client
    final IResourcePlanningClient resourcePlanning =
        (IResourcePlanningClient) this.teamRepository.getClientLibrary(IResourcePlanningClient.class);

    // Get the contributor related planning information
    IContributorInfo info =
        resourcePlanning.getResourcePlanningManager().getContributorInfo(inspectUser, true, monitor);
    ItemCollection<IWorkResourceDetails> workDetails = info.getWorkDetails(inspectUser);
   
    for (IWorkResourceDetails iWorkResourceDetails : workDetails) {
.........
//For example to get timeline
IDevelopmentLineHandle developmentLine = iWorkResourceDetails.getDevelopmentLine();
.........
}

----------------------------------------------------------------
In the above code I can able to fetch all details except "Default Allocation" information.

This information is stored as a boolean. I had tried/used all the necessary methods to find it but no use.

Please let me know is there any way to find that information.

Thanks in advance.

0 votes


Accepted answer

Permanent link
This is how I think that works:

	/* (non-Javadoc)
	 * @see com.ibm.js.team.admin.automation.allocation.core.IWorkAssignment#isDefaultAllocation()
	 */
	@Override
	public boolean isDefaultAllocation() {
		Timestamp calStartTS = SimpleDateFormatUtil
				.createTimeStamp(
						SimpleDateFormatUtil.CalendarStart,
						SimpleDateFormatUtil.SIMPLE_DATE_FORMAT_PATTERN_YYYY_MM_DD_HH_MM_SS_Z);
		Timestamp startTS = new Timestamp(getStartDate().getTime());
		Timestamp calEndTS = SimpleDateFormatUtil
				.createTimeStamp(
						SimpleDateFormatUtil.CalendarEnd,
						SimpleDateFormatUtil.SIMPLE_DATE_FORMAT_PATTERN_YYYY_MM_DD_HH_MM_SS_Z);
		Timestamp endTS = new Timestamp(getEndDate().getTime());

		boolean sameStart = startTS.equals(calStartTS);
		boolean sameEnd = endTS.equals(calEndTS);
		return sameStart && sameEnd;
	}
ast java selected this answer as the correct answer

0 votes

Comments

Thanks Ralph.


I had similar thought to check the start and end dates and get that value.

It meant that there is no direct way of getting the boolean value?

Not that I am aware of, otherwise I would have let you know.

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
× 457

Question asked: Aug 16 '16, 9:03 a.m.

Question was seen: 2,021 times

Last updated: Aug 17 '16, 2:31 a.m.

Confirmation Cancel Confirm