It's all about the answers!

Ask a question

What are the server side java API's for accessing RTC server and what are the specific classes for "IRepositoryItemService", "ILinkServiceLibrary" , " getService()" method in the below piece of code?


Megha Nair (11) | asked Mar 01 '18, 4:02 a.m.

Iam trying to retreive the changesets associated with a workitem.This is my code.

public class get_changesets {

    private List<IChangeSet> getChangeSets(IWorkItem wi)
            throws TeamRepositoryException {
       
        IRepositoryItemService repositoryItemService = getService(IRepositoryItemService.class);

        ILinkService linkService = getService(ILinkService.class);
        ILinkServiceLibrary linkLibrary = (ILinkServiceLibrary) linkService
                .getServiceLibrary(ILinkService.class);
        IItemReference workItemRef = IReferenceFactory.INSTANCE
                .createReferenceToItem(wi);
        ILinkQueryPage linkPage = linkLibrary.findLinks(
                WorkItemLinkTypes.CHANGE_SET, workItemRef);

        List<IChangeSet> changeSets = new ArrayList<IChangeSet>();

        for (ILink link : linkPage.getAllLinksFromHereOn()) {
            // Change set links should be item references
            IChangeSetHandle changeSetHandle = (IChangeSetHandle) link
                    .getSourceRef().resolve();
            IChangeSet changeSet = (IChangeSet) repositoryItemService
                    .fetchItem(changeSetHandle, IRepositoryItemService.COMPLETE);
            changeSets.add(changeSet);
        }
        return changeSets;
    }
}

what are the server side classes for "IRepositoryItemService", "ILinkServiceLibrary" , " getService()" method?
How do I access the server side API's of RTC server?
        

One answer



permanent link
Ralph Schoon (57.0k23642) | answered Mar 01 '18, 4:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Mar 01 '18, 5:00 a.m.

You might want to start here
https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/

And run the Extensions Workshop which actually shows how to get the services and also allows to search for source code once the SDK has been set up. You can then answer your own question.

https://rsjazz.wordpress.com/ has various easy to search for client and server API questions as well. I am pretty sure there are examples for most of the main server API services. In the area you are asking https://rsjazz.wordpress.com/2012/11/01/restrict-delivery-of-changesets-to-workitem-types-advisordelivery-of-changesets-associated-to-wrong-work-item-types-advisor/ and related past would likely be most valuable.

Your answer


Register or to post your answer.