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

WorkItem details from Changeset ID

The task I am trying to achieve is to fetch the WorkItem Info, given the Changeset ID. I have the ChangesetID (for e.g. a value like _GnlR8RwDEeO-t7oYqwMn0H ). With this value I need to query the WorkItem information using Plain Java APIs. 

Please provide your thoughts in achieving this.

0 votes


Accepted answer

Permanent link
If the change-set has a work-item associated, you can retrieve the work-item information using the ILinkServiceLibrary.class service:
ILinkService linkService = getService(ILinkService.class);
ILinkServiceLibrary linkServiceLibrary = (ILinkServiceLibrary) linkService.getServiceLibrary(ILinkServiceLibrary.class); ILinkCollection csLinks = linkServiceLibrary.findLinks(ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID, reference).getAllLinksFromHereOn(); // ...
If you know the UUID of the change-set, you can create the reference to it as:
UUID uuid = UUID.valueOf("_GnlR8RwDEeO-t7oYqwMn0H");
IChangeSetHandle csH = (IChangeSetHandle)IChangeSet.ITEM_TYPE.createItemHandle(uuid, null);
IReference reference = IReferenceFactory.INSTANCE.createReferenceToItem(csH);
Cheers.
Reji GL selected this answer as the correct answer

1 vote

Comments

Thanks for responding.


The provided solution is apt while using server side api. But I am using the client side APIs.

On client side we use ILinkManager.class, instead of ILinkServiceLibrary.class, but the behaviour is quite the same.

Yeah.. I go it working.. Thank you.

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,938

Question asked: Sep 17 '13, 3:52 p.m.

Question was seen: 5,274 times

Last updated: Sep 23 '13, 5:31 p.m.

Confirmation Cancel Confirm