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

How to get work item included in build result using java server API

How can get work item included in build result using java server API, I am looking for API from build component.

0 votes



One answer

Permanent link
We use the code below to get the list of included work items:

IBuildResultHandle buildResultHandle = ...

List<IWorkItemHandle> includedWorkItems = new ArrayList<IWorkItemHandle>();

ILinkManager linkManager = (ILinkManager) teamRepository.getClientLibrary(ILinkManager.class);
IReference source = linkManager.referenceFactory().createReferenceToItem(buildResultHandle);
ILinkCollection referencesToResults = linkManager.findLinksBySource(BuildLinkTypes.INCLUDED_WORK_ITEMS, source, monitor).getAllLinksFromHereOn();

for (Object object : referencesToResults) {
    ILink link = (ILink) object;
    IWorkItemHandle workItemHandle = (IWorkItemHandle) link.getTargetRef().resolve();
    if (workItemHandle != null) {
        includedWorkItems.add(workItemHandle);
    }
}

0 votes

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,937
× 562
× 234

Question asked: Jun 18 '19, 5:16 a.m.

Question was seen: 2,637 times

Last updated: Jun 19 '19, 6:19 a.m.

Confirmation Cancel Confirm