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

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

0 votes



One answer

Permanent link
How about

  1. Getting the old state of the work item
  2. Getting the new state of the work item
  3. Getting the approvals from the old state
  4. Getting the approvals from the new state
  5. Figuring if there is a new one by comparing the number of attachments and finding the one that is not in the old list (maybe there is a date on the approval, not sure)

0 votes

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

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?
I don't see any applicable methods in the IApprovalDescriptor interface.

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

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,939

Question asked: Jan 18 '16, 1:43 p.m.

Question was seen: 2,303 times

Last updated: Jan 25 '16, 2:35 p.m.

Confirmation Cancel Confirm