It's all about the answers!

Ask a question

Does not load IWorkItemPostSaveParticipant


Riddhi Shah (3721518) | asked Aug 06 '12, 9:08 a.m.
edited Aug 06 '12, 1:17 p.m. by Jared Burns (4.5k29)
Hi,

I need to update state of RTC Defect on save operation. For example, If user has moved status to "Reopen", description should be updated with "Reopen template" automatically. To achieve this I tried to create IWorkItemPostSaveParticipant Plugin as follow :

public class CheckSave extends AbstractService implements IWorkItemPostSaveParticipant{

HttpResponse response;

HttpClient httpclient;

public static final String WI_TYPE = "wiType"; //$NON-NLS-1$

public static final String WORKFLOW_ACTION = "workflowAction";

public void run(ISaveParameter saveParameter) throws TeamRepositoryException

{

IWorkItem workItem = (IWorkItem) saveParameter.getNewState();

if (workItem != null) {

StringBuffer res = new StringBuffer();

res.append("Got a workItem with data [");

res.append("Duration=" + workItem.getHTMLDescription() + "\n");

res.append("Id=" + workItem.getId() + "\n"); // object

System.out.println(res);

workItem.setHTMLDescription(XMLString.createFromPlainText("Added from plugin"));

}

On deploy, plugin does not get loaded.



One answer



permanent link
sam detweiler (12.5k6195201) | answered Aug 06 '12, 9:44 a.m.
I think u started with the wrong base class

here is from one of mine

public class WorkItemFailAdvisor extends AbstractService implements IOperationAdvisor{

Sam

Comments
Riddhi Shah commented Aug 06 '12, 9:55 a.m.

Thanks for the reply. For precondition I am using IOperationAdvisor which works fine, but on precondition plugin we can not update the state of workitem. I need to create a plugin for followup action which is triggered on post save so that I can update the state of workitem.

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.