It's all about the answers!

Ask a question

How to get all the changes made in a work item by using server side Plugin in ccm.


Pavan M (393) | asked Apr 26 '21, 9:50 p.m.
Hi,

I had a work item in that I will make some changes and save it. When I save the work item a mail will send in that mail I need to get what are all changes made in work item. How to achieve this using server side Plugin. I am able to send a mail but I am not getting how to get all changes done in the work item before saving the work item. Any Suggestion please.

Thank you,
Regards,
Pavan m.

One answer



permanent link
Shashikant Padur (4.2k27) | answered May 19 '21, 1:23 a.m.
JAZZ DEVELOPER

 ILinkServiceLibrary linkService = (ILinkServiceLibrary) getService(ILinkService.class).getServiceLibrary(ILinkServiceLibrary.class);

IItemReference workItemReference = IReferenceFactory.INSTANCE.createReferenceToItem(workItemHandle);

ILinkQueryPage page = linkService.findLinks(ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID, workItemReference);

ILinkCollection links = page.getAllLinksFromHereOn();


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

for (ILink link : linkCollection) {

    IChangeSetHandle csHandle = (IChangeSetHandle) ((IItemReference) link.getSourceRef()).getReferencedItem();

    changeSets.add(csHandle);

}


Your answer


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