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 (63.3k●3●36●46)
| answered Jan 18 '16, 2:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
How about
Comments
Sudheer Rugbeer
commented Jan 18 '16, 3:19 p.m.
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
Geoffrey Clemm
commented Jan 18 '16, 7:27 p.m.
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.
Sudheer Rugbeer
commented Jan 24 '16, 12:26 a.m.
How do I get the UUID's of the approvals?
Ralph Schoon
commented Jan 25 '16, 11:25 a.m.
| edited Jan 25 '16, 11:26 a.m.
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.
sam detweiler
commented Jan 25 '16, 2:35 p.m.
You could use the hashCode() method, which should return a unique value
showing 5 of 6
show 1 more comments
|
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.