How do I find newly added Approvals in a Operation Advisor?
![]()
Hi
I am developing a server-side operation advisor extension, which needs to allow a specific role from creating specific Approvals (based on the approval name). This approval can be added at any point in the Work Item workflow.
How can I find out what are the newly created approval descriptors during a work item save?
Thank you,
Sudheer
|
One answer
![]()
Ralph Schoon (61.8k●3●36●43)
| answered Jan 18 '16, 2:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
How about
Comments Hi Ralph
This is the approach I am following, however there is a scenario where an approval can be added and another deleted in the same save operation, which would mean that the old number of approvals is the same as the new number. However, I can work around this by creating another extension which prevents deletion of approvals.
I was hoping that there would be a more reliable to determine what approvals where added, removed, or changed as part of the save operation.
Thanks,
Sudheer
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Just modify step 5 to say "Compare the entries on the old list of approvals with the entries on the new list of approvals. If there are any differences, fail the save request."
Also have a look at the UUID's of the approvals. These are unique and would allow you to determine any changes if you iterate both lists.
How do I get the UUID's of the approvals?
![]() FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Interesting, usually everything has a UUID, but I couldn't find anything for approvals at a glance. You could try to debug if you can see anything that you could use to compare. Otherwise you have to resort to a text compare, which is not very precise.
You could use the hashCode() method, which should return a unique value
showing 5 of 6
show 1 more comments
|