Removing completed task from a list

Hi,

I am using Camunda to build a vacation request application and I am using the REST API to get the requests by process id and display them in a list where the user approves or denies the request. To display the requests that need to be approved I am using GET task by process id which displays all the instances with user tasks, to approve the task I pass data with POST task/id/complete, and on approval can remove it from the list however on page refresh all the requests (approved and not) display on the list. My train of thought is that I would filter through the array of process instances and get only ones that have active user tasks but I haven’t been able to find anything in the documentation or google on how or if it’s even possible. Thanks in advance!

https://docs.camunda.org/manual/7.16/reference/rest/task/post-query/

This document suggests that if you pass active:true in your Post request, that you’ll only get active tasks back.

1 Like

Thank you for the reply! I ended up getting it to work by setting my variable to “pending” at default, (once the task is complete it passes an “approved” or “deny” value to the variable) and filtering the tasks to show only to those who are pending. But I will keep this in mind for next time or when we refactor the application. Thanks again!