It's all about the answers!

Ask a question

RTC API WorkItem Profiles not working!?

Marko Tomljenovic (3163687) | asked Apr 10 '16, 5:08 p.m.
 I am having a big utility class for various RTC read operations. One is also for reading work items according to a given profile.

I also have some tests that run against a real server. The tests about reading a work item for a given id and  WorkItem profile are all failing because as it seems the work items are always loaded fully, even if I use the small profile.
I am using this call for getting a work item IWorkItemClient.findWorkItemById(id, profile, monitor);

After debugging I came to the class ItemManager and method internalFetchItem.
There I can see the code:
private IManagedItem internalFetchItem(final Location location,
            final Set properties, IProgressMonitor monitor)
            throws TeamRepositoryException {
        if (location == null) {
            throw new IllegalArgumentException("location must not be null"); //$NON-NLS-1$
        IManagedItemHandle itemHandle = (IManagedItemHandle) location
        if (itemHandle != null) {
            return internalFetchItem(itemHandle, properties, monitor);
        } else {
            return internalFetchRest(location, true, monitor);
In my tests the itemHandle from the location is always 'null' and therefore the work item is always fully loaded.

Is my test set up (, the repository login procedure) the problem? Or is there a misunderstanding how the profile should be used?

Thank you

Ralph Schoon commented Apr 11 '16, 1:47 a.m.

I have seen forum responses, that state the profiles are not really implemented. I have however also seen that I did not get custom attributes If  I use a small profile. So the truth may be in the middle.

The other thing is that locations are cross repository (CLM links like tracks) as far as I know and might work different from IAuditableHandles.

Be the first one to answer this question!

Register or to post your answer.