Can not configure WorkItem State Change Event
Hi,
I want to configure Work item state change event. It does not allow me to configure event. In Process configuration -> Team Configuration -> Event Handling , it does not enable add button. Can anyone please guide me on how to enable this ? Or what are steps to configure events ? |
3 answers
I suspect you need to have a follow-up action that is suitable for use with events defined in order for the add button to be enabled. The button should let you associate an existing follow-up action with a particular event.
You can search the forum for "follow-up action" to see some discussions about how you would do this.
Comments
Riddhi Shah
commented Aug 10 '12, 12:13 a.m.
Thanks Daniel. I tried to configure "Followup Action" on WorkItemSave. What happens with that is , it gives control before saving the defect and not after it. So, say if my followup action will fail workitem will not be saved. I need some event which gets executed after save.
|
Hi Eiddhi,
Followup action will get executed after the workitem save operation. The failure of a followup action occurs only in case of exceptions where your conditions are not met (or) the operation particpant contains erroneous code. Thanks. |
Hi Valli L,
Thanks for the reply. My concern is if i run my plugin in debug mode , debugger ( control ) should come to my plugin after the save on defect is done. here, what i get is while saving only it gives control to debugger and if in case followup action fails it fails save operation as well. As the name suggest its followup action I expect save to be done regardless of followup action. I also create one pre-condition plugin , and deployed both plugin in RTC. Now I edited one of my defect and clicked on save from RTC. In debugger , it comes before saving defect it comes to pre-condition plugin first and on success of that , it goes to followup action and after that it saves defect. So, in such case what is really difference between pre-condition and followup action ? Following is my plugin.xml
<extension
public class FridayTestClass extends AbstractService implements IOperationParticipant { private static final String SAVE_SUMMARY="summary"; private IWorkItemServer workItemServer; private IWorkItemCommon wiCommon; public void run(AdvisableOperation operation, IProcessConfigurationElement participantConfig, IParticipantInfoCollector collector, IProgressMonitor monitor) throws TeamRepositoryException { // TODO Auto-generated method stub Object data = operation.getOperationData(); if (data instanceof ISaveParameter) { ISaveParameter saveParameter = (ISaveParameter) data; IAuditable auditable = saveParameter.getNewState(); if (auditable instanceof IWorkItem) { workItemServer = getService(IWorkItemServer.class); wiCommon = getService(IWorkItemCommon.class); IWorkItem workItem = (IWorkItem) auditable; IWorkItem workItemWC = (IWorkItem)workItem.getWorkingCopy(); if (workItemWC == null) { System.out.println("Work Item not found."); return; } try { IAttribute summaryAttribute = wiCommon.findAttribute(workItemWC.getProjectArea(),SAVE_SUMMARY, monitor); workItemWC.setValue(summaryAttribute, "updated from plugin"); workItemServer.saveWorkItem2(workItemWC, null, null); } catch (Exception e) { e.printStackTrace(); } } } } |
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.