It's all about the answers!

Ask a question

how to get value of an attribute like actual effort in a work request , when a work request is being saved?


Rishi Sharma (6515) | asked Jul 03 '16, 10:21 a.m.
 Hi All,

We have to create a utility, which gets triggered and checks transition of status of a workrequest like current status and new status when it is being saved.
The utility sets a particular value to some fields/attributes in work request, when current status is Plan and new status to be saved is Delivery.
We also want to check the current values of some fields/attributes of work request before it is being saved.
Please let me know how to check the already existing values and the new values of attributes before saving workrequest.

Thanks in advance

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Jul 03 '16, 2:28 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 03 '16, 2:29 p.m.
See  RTC Update Parent Duration Estimation and Effort Participant and related posts. This is a participant or follow up action. An precondition or advisor would be to check and prevent the save if undesirable.

Comments
Rishi Sharma commented Jul 04 '16, 12:24 a.m.

 Hi Ralph,

Thanks for quick response.

but the above post kind of did not solve my purpose as I want to get an existing value of an attribute like actual effort and also the new value that the user has entered and is trying to save the work request.

We have to compare this existing and new value of the attribute of the workrequest and then based on this comparison, our code will take a decision whether to save the workitem or just throw an error message.


Ralph Schoon commented Jul 04 '16, 2:23 a.m. | edited Jul 04 '16, 2:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The participant or advisor gets the new state and the old state.

saveParameter.getNewState() and (IWorkItem) saveParameter.getOldState();

as described in the Extensions workshop. You can use the code to get the value of an attribute fr the old state and the new state and compare the values.


Rishi Sharma commented Jul 04 '16, 8:19 a.m.

  Can you give me the exact link for the same?


Ralph Schoon commented Jul 04 '16, 8:25 a.m. | edited Jul 04 '16, 8:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If you just get started with extending Rational Team Concert, or create API based automation, start with the post Learning To Fly: Getting Started with the RTC Java API’s and follow the linked resources.

If you want to do this kind of work, you basically have to go through the information provided and the workshop. You will also require to have or build up skills in finding information as well as knowledge around Java and Eclipse extension development. Doing the extensions workshop mentioned in the link above is important.

This is definitely not the kind of "please provide me with all the code" domain.

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.