Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to get a IWorkItemRepositoryService object?

I'm trying to use the IWorkItemRepositoryService to get the history of a work item using the following code. However, I always get null when I try to get the IWorkItemRepositoryService object in the first line. Any hints how I can get an instance of this class?

IWorkItemRepositoryService service = (IWorkItemRepositoryService) repository.getClientLibrary(IWorkItemRepositoryService.class);
            
            if (service != null) {
            ChangeLogDTO[] history = service.computeHistory((com.ibm.team.workitem.common.model.IWorkItem) item.getInternalRepresentation());
            
            for (ChangeLogDTO change : history) {
                System.out.println(change.toString());
            }

0 votes



2 answers

Permanent link
Hi,

you are trying to get the service as a client library, which is a call to get the client API.

From what I can see that internal Service is likely a part of the Server API. If you are working on the server you should extend AbstractService and use getService() to get it.

If you develop for the the Client Libraries, look for an analogue Client Library.

1 vote

Comments

Thanks! I'm working on the client side, but I have problems to find the appropriate client library...


Permanent link
There is        

WorkItemClient aWorkItemClient = (WorkItemClient) teamRepository
        .getClientLibrary(WorkItemClient.class);

But the class is internal and I am not sure if you can get it as a client. The IWorkitemClient which is the client library interface I am usually using does not expose a similar method.

1 vote

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,925

Question asked: Nov 12 '12, 11:30 a.m.

Question was seen: 5,262 times

Last updated: Nov 12 '12, 12:16 p.m.

Confirmation Cancel Confirm