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

How to retrieve workitem changes and attribute modifications?

Hi All,
            I have written a code to fetch the attribute values from a workitem - triggered on the save operation (Operation Participant Plugin). I want to distinguish if it's a new/modify/delete operation - plus the changes that are made during each of the save operation - like the old and new values of a particular attribute and so on. How can this be achieved programatically?

Thanks.

0 votes



3 answers

Permanent link
Hi Valli.

Below code snippet will solve your query

        Object data = operation.getOperationData();
        if(data instanceof ISaveParameter){   
            ISaveParameter saveparameter = (ISaveParameter)data;
            IAuditable WIOldState = saveparameter.getOldState();
            IAuditable WINewState = saveparameter.getNewState();
             ..........
             ...........
             ...........

In this code, WIOldState will have the Old values of the work item attributes and WINewState will have the values during the save.
Of course, if WIOldState== null, then it means Creation of NEW Work Item.

Hope its usefull.

Regards
Muthukumar.C

0 votes

Comments

Hi Muthukumar,

                           How to capture the delete operation?

I cant see any point in capturing the Delete operation. What ever the code you are writing in the Plugin will be executed during the SAVE operation. (Modification / Creation)

In which scenario you want to capture the delete operation.??

Hi,
      the scenario is such that we are updating 1 parent record - which is of another WI Type based on updations made in WI Items of another category. So, when a WI is deleted, i will have to restore the values in the parent record to deduct the contents of the deleted record. Its more of calculation based

Thanks.

Sorry valli, I am totally out of loop now.

Actually you are having a Plug-in that will execute when saving a work item. (Create / Modify)
In the plug-in code itself, you will delete another work item or what? I am not sure whether I am reading you correctly.

Else, Are you asking for - your code should execute during the deletion of WI manually???

Better to post some code from your plug-in so that I can see the workflow of the Plug-in and where your requirement is hidden


Permanent link
Hi,
       I have a plugin that executes on WI-Save operation and its an Operation Participant. Once a record is created, i use the values to update another WI record (different WI Type). So, i want to execute a part of the code in the same plugin - during deletion of WI - to redo the changes made. How to capture the WI delete operation?

Thanks.

0 votes


Permanent link
Hi Valli,

After a long, I hope, I got a solution for your requirement....
Hope you remember that we will mention Plugin Action as WorkItemSave during the creation of Plug-in.

Same way, you can create a plugin which will execute during the Delete operation of WIs. You can add this plugin in the preconditions of the Delete Work Item [Server]

Regards
Muthukumar.C

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
× 10,951
× 369

Question asked: Jun 06 '12, 5:45 a.m.

Question was seen: 5,161 times

Last updated: Jun 29 '12, 3:27 a.m.

Confirmation Cancel Confirm