It's all about the answers!

Ask a question

How can I use the RTC API to set a work item category to restricted (access and view) ?


Steffen Liebert (112) | asked Dec 12 '13, 6:24 a.m.
edited Dec 12 '13, 6:36 a.m.
Hello,

how can the work item category be set to restricted access / restricted viewing using the API? There is a method in the ICategory ( isReadAccessEnabled() ) to evaluate whether if read access is enabled or not. But I did not found a method to set these value.



Comments
sam detweiler commented Dec 12 '13, 6:52 a.m.

most of the process mgmt administration functions are not exposed (internal apis), or there is some private storage not documented for application usage.

many times I have had to read the product source code to determine how the product does it, and then evaluate if I want to carry that risk in my coding.

One answer



permanent link
Dimitrios Dentsas (7348) | answered Mar 12 '14, 5:45 a.m.
edited Mar 12 '14, 5:49 a.m.
As Sam already said you have to evaluate the risk of using internal APIs that could possibly break your code in future releases.

But to answer your original question, you can set the read access on a category the following way by using
com.ibm.team.workitem.common.internal.model.Category

ICategory category = ...;
IWorkItemServer fWorkItemService = fWorkItemService = getService(IWorkItemServer.class);


Category internalCategory = (Category) (ICategory) category.getWorkingCopy();

internalCategory.setReadAccessEnabled(value) //  value = true|false
return fWorkItemService.saveCategory((ICategory) internalCategory, monitor);

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.