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

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 ?

0 votes



3 answers

Permanent link
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.

0 votes

Comments

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.

  • riddhi


Permanent link
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.

0 votes


Permanent link
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
         point="com.ibm.team.process.service.operationParticipants">
      <operationParticipant
            class="fridaytest.FridayTestClass"
            id="FridayTest.operationParticipant1"
            name="friday test"
            operationId="com.ibm.team.workitem.operation.workItemSave">
         <extensionService
               componentId="FridayTest.extensionService"
               implementationClass="fridaytest.FridayTestClass">
            <prerequisites>
               <requiredService
                     interface="com.ibm.team.workitem.service.IWorkItemServer">
               </requiredService>
               <requiredService
                     interface="com.ibm.team.workitem.common.IWorkItemCommon">
               </requiredService>
            </prerequisites>
         </extensionService>
      </operationParticipant>
   </extension>

Following is my code:

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();
                               
                            }
                                   
                           
            }
        }
    }

0 votes

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
× 6,125

Question asked: Jul 27 '12, 2:40 a.m.

Question was seen: 4,630 times

Last updated: Aug 10 '12, 2:27 a.m.

Confirmation Cancel Confirm