Get timesheet attribute with RTC Java API
Hi,
I want to get each timesheet entry of all tasks per day using the Java API. I could not find an example of how to do this.
Someone would know how to do this?
Thanks in advance.
|
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Nov 26 '13, 10:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
As far as I remember that data was stored with a special reference/link. Can you have a look at https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ or https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/ and check,if you can use that code to find the specific links. I have no example at hand.
Tayane Fernandes selected this answer as the correct answer
|
One other answer
Below is the code to get references on the Work Item :
IWorkItemReferences references = workingCopy.getReferences(); Of all the references, we are interested in the WORK_TIME end point references: List <IReference> timesheets = references.getReferences(WorkItemEndPoints.WORK_TIME); for each such reference, resolve the reference to a time sheet entry through the time sheet entry handle : IItemReference timeSheetReference = (IItemReference) reference; ITimeSheetEntryHandle timeSheetEntryHandle = (ITimeSheetEntryHandle) timeSheetReference.resolve(); ITimeSheetEntry tsEntry = (ITimeSheetEntry) mTeamRepository.itemManager().fetchCompleteItem(timeSheetEntryHandle, IItemManager.DEFAULT, mProgressMonitor); Now, the tsEntry can be used to access various details on the entry like : tsEntry.getHoursSpent() tsEntry.getStartDate() tsEntry.getCreator() tsEntry.getTimeCode() and so on... |
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.