Change state event - update WorkItem
![]()
Hi,
I would like to change some attribute after a chenge state event. I created a new plu-in <xml> <eclipse> <plugin> <extension> <operationParticipant> <extensionService> <prerequisites> <requiredService> <requiredService> <requiredService> </prerequisites> </extensionService> </operationParticipant> </extension> <extension> <eventHandler> <extensionService> <prerequisites> <requiredService> <requiredService> <requiredService> </prerequisites> </extensionService> </eventHandler> </extension> </plugin> and a class Evento public class Evento extends AbstractService implements IChangeEventHandler { private IProcessConfigurationElement fConfigurationElement; private IProjectArea fProjectArea; private IProcessArea fProcessArea; @Override public void handleEvent(IChangeEvent event, IProcessConfigurationElement handlerConfiguration) throws TeamRepositoryException { // TODO Auto-generated method stub fProcessArea = (IProcessArea) event.getProcessArea(); IRepositoryItemService repoService = super.getService(IRepositoryItemService.class); fProjectArea = (IProjectArea) repoService.fetchItem(fProcessArea.getProjectArea(), IRepositoryItemService.COMPLETE); IAuditable auditable = ((ISaveParameter) event).getNewState(); IWorkItem workItem = (IWorkItem) auditable; String summary = workItem.getHTMLSummary().getPlainText(); if(summary.contains("te")) { IWorkItemServer service= getService(IWorkItemServer.class); workItem.setHTMLSummary(XMLString.createFromPlainText("Example work item")); service.saveWorkItem2(workItem, null, null ); } }} but don't work. Any suggestion?? |
One answer
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.