How Can I Use the OSLC API to Generate TimeSheetEntries?
I am investigating creating a tool to keep track of the time spent working on tasks in RTC. The tool will run outside of the eclipse client and will incorporate a Record/Stop feature. Whe the user selects "Record", the tool will start a timer. When the user selects "Stop", the tool will automatically generate a TimeSheetEntry in the appropriate Work Item's Time Tracking tab in RTC. In order to make this work, I need to be able to programmatically modify the TimeSheetEntries on the Time Tracking tab of a work item in RTC. I've read that you cannot do this using REST APIs, but it appears that this should be possible using OSLC APIs. I've already successfully used the OSLC API in the past to update things like a Work Item's summary or description. However, I've had a hard time duplicating that feat with collections associated with a Work Item (e.g., Approvals and TimeSheetEntries). I'm able to directly modify the work item's "Time Spent" attribute, but cannot seem to do that for a specific TimeSheetEntry. I've only had success doing it for the Work Item as a whole. Can anyone point me at a resource (or provide me with some code examples) of how you can do this with the OSLC API? My programming language of choice is VB.Net. |
3 answers
Ralph Schoon (63.6k●3●36●46)
| answered Mar 31 '15, 10:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
For anyone who searches for example, I created example code to access and modify the time tracking data for work items and published in this post: https://rsjazz.wordpress.com/2015/03/31/the-work-item-time-tracking-api/
This is however for the Plain Java API. However, the information there might help with understanding how to set the data using OSLC as well. Basically it is necessary to retrieve the linked entries and to update/create entries and link them to the work item. Comments
Nate Decker
commented Mar 31 '15, 11:45 a.m.
Your timing is supernatural. My understanding in the past was that the OSLC API cannot create Timesheet entries, only read them. I had given up on the idea. However, just this morning it occurred to me that I could implement a work-around by adding a specially formatted comment to Work items via OSLC and then having a server-side operation behavior detect and parse that comment to create the Timesheet entries. I was literally about to search Jazz.net for posts on accessing timesheet entries via the Java API when I received your comment notification. So I say again, your timing is supernatural. I'll have to take a look at your example. I'm looking at doing this with a Server-Side extension and am not sure if that's what your example code does, but hopefully even if it is client-side, it will be similar enough to be of use. Thanks. Hi Nate,
|
Hello Nate,
should help you.
Thanks,
Eric
|
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.