how to test if a work item approval has been deleted during a work item save operation?
Hello,
I've written a simple operation advisor (precondition) which is executed in response to a work item save operation. The advisor has to verify if a work item approval has been removed prior to saving the work item. For that purpose the advisor gets the old and the new state (of type IWorkItem) of the work item, fetches their approvals and the corresponding approval descriptors, and verifies if all approval descriptors of the old state are present in the new state. If one of the old state approvals is missing in the new state (verified by the descriptors' equals method) the advisor concludes that an approval has been deleted. Another test case is: Instead of deleting the existing approval, the tester creates a new one (along with the existing approval). In order to make a test I created a story work item with an approval of type "review". Then another approval is created and the work item "Save" button is clicked. As a result: - the list with approvals fetched from the old and the new states of the work item are different objects. - the list with approval descriptors, which are fetched from the old and the new states of the work item are different objects. - The corresponding IAapproval and IApprovalDescriptor objects are also different (although only a new approval is created and the existing one is not changed. I'd expect that at least the descriptor of the first approval is the same object in both states). - There is no unique approval descriptor ID which can be used to compare old and new state approvals. Is there a way to test if an approval has been deleted prior to saving the work item? Your help would be really appreciated! Source code Environment: RTC 5.0.2 public void run (AdvisableOperation operation, Best Regards |
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Oct 10 '16, 10:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 10 '16, 10:36 a.m.
As far as I can tell, the only thing you can do is to use the number of approvals, the type and the other available values to determine if the old and the new approval is the same. There is no UUID for any of these interfaces that I would be aware of that could otherwise be used.
Krasimir Malchev selected this answer as the correct answer
Comments
Krasimir Malchev
commented Oct 10 '16, 10:39 a.m.
Thanks a lot!
Ralph Schoon
commented Oct 10 '16, 10:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I have wondered over this also at some point in time. If you want this to change please create an enhancement request.
|
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.