It's all about the answers!

Ask a question

Not able to set time tracking for the task owner using java


Namrata K (1312) | asked Mar 26, 3:38 a.m.
There is a restriction that only the owner of the workitem can edit the time tracking tab, keeping that restiction in place, can we edit the time tracking tab as the owner of the workitem using java. I tried this piece of code but not able to edit in UI and also doesn't throw any error.

entry.setCreator(workItemHandle.getOwner());
        entry.setStartDate(now);
        entry.setTimeSpent(twoHours);
        entry.setTimeCode(timeCode.getTimeCodeLabel());
        entry.setTimeCodeId(timeCode.getTimeCodeId());
        entry.setWorkType(workType);

Accepted answer


permanent link
Ralph Schoon (63.4k33646) | answered Mar 26, 3:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Namrata K selected this answer as the correct answer

Comments
Namrata K commented Mar 26, 4:39 a.m. | edited Mar 26, 4:40 a.m.
Hi,

I have gone through this link already but still not able to resolve the issue keeping the restriction in-place.

Ralph Schoon commented Mar 26, 4:45 a.m. | edited Mar 26, 7:34 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There is no real information in your question, the code is as incomplete as possible. The error description is lacking any useful detail.

The Link I provided and the links to the team wiki  contains the information you need to enter time tracking information.

If you are running in the client API, and you do not have the permission to write the data, then you don't have the permission to write the data. The only things you can try is to run with another user e.g. JazzAdmin role and hope there is an override, or give yourself the permission, if it is configurable.

If you run in a server extension it is technically possible to elevate to run as an administrator.


Namrata K commented Apr 08, 9:54 a.m.

Got it, thank you

Your answer


Register or 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.