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

How to remove every approval from a work item in java?

I am currently writing an operation behavior that removes all approvals from a work item when the work item is moved back to another state. My operation behavior so far does not remove any of the approvals from the work item. Here is the code I currently have for removing approvals.


public void removeApprovals(IWorkItem currentWorkItem) throws TeamRepositoryException {
        IApprovals approvals = currentWorkItem.getApprovals();
        List<IProval>approcalConent = approvals.getContents();

        for(IApproval approval: approvalContent) {
               IApprovalDescriptor descriptor = approval.getDescriptor();
               approvals.remove(approval);
               approvals.remove(descriptor);
          }
}

Is there something I am missing or doing wrong when it comes to deleting approvals?

0 votes



One answer

Permanent link
and this is the server API: https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ it shows creation, but should provide a good idea how the API works.

You need a working copy and/or use a workitem operation. You need to save the items, including the work item. 

0 votes

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
× 11,079
× 7,599
× 1,428

Question asked: Nov 12 '25, 3:29 p.m.

Question was seen: 354 times

Last updated: Nov 13 '25, 9:37 a.m.

Confirmation Cancel Confirm