How can a Work Item be prevented from being Closed if there are any pending Approvals?
It is a specific use case and wondered if anyone has a specific solution.
We want to stop a Work Item from being Closed if there are any Approvals pending. The problem is that Approvers can still receive emails if Approvals are overdue even though the Work item is Closed.
If a Work Item has multiple workflow actions to a 'Closed' state is it possible to inhibit either the transitions or Work Item 'Save' if there are any Approvals pending.
Thanks for any help.
Accepted answer
You have to write a custom advisor that checks this during the save and blocks the save. For an example see
https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/
The approval API: https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ and https://rsjazz.wordpress.com/2012/10/01/adding-approvals-to-work-items-using-the-plain-java-client-libraries/
You would have to read the approvals from the new state and check if one is open.
See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ to get started.
https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/
The approval API: https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ and https://rsjazz.wordpress.com/2012/10/01/adding-approvals-to-work-items-using-the-plain-java-client-libraries/
You would have to read the approvals from the new state and check if one is open.
See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ to get started.