prohibit work item closures if it has any active pending approvals
Is it possible to stop a Work Item from being Closed if there are any Approvals pending ? It is misleading for RTC to allow closure of work item with pending approval if there are any on the work item. I would like both following user cases covered which one would expect RTC to offer out the box as a good practise.
A) work item with no approvals should be allowed to be closed.
B) work item with approval pending should NOT be allowed to be closed.
There is a precondition available called "Required Approval" however enabling this precondition mandate the work item type must always have Approval.
One answer
Hi,
as far as I am aware you would have to create a custom advisor.
The participant https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ can show a bit the approval API. It has links to how to get started. https://rsjazz.wordpress.com/2016/07/15/build-on-state-change-work-item-save-participant/ can help with first steps in how to look at work item state changes.
You need to do this in an advisor/precondition (the examples are participants/follow up actions). A precondition looks like https://rsjazz.wordpress.com/2014/05/26/only-owner-can-close-workitem-advisor/. Both use the same other APIS.