Active filter for get Tasks(POST) true/false/empty giving all the tasks

Hi,

I am setting { “active” : true } as a request parameter while making get tasks(POST) . it is giving same result for true/false/empty.

What is the use then?

Thanks,
Sindhu.

For POST Query, you need to send it as request payload(JSON format), not in request parameters.

{
  "active": true
}

yeah i meant in request body. I am sending as payload itself. the same way you mentioned. But true/false/empty returning same result.

I also tested it. same issue.

For querying tasks you can refer this historic task api. this api i’m using in my projects.

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

To get active tasks, set these attributes:

processUnfinished=true
unfinished=true

To get finished tasks, set these attributes:

processFinished=true
finished=true
1 Like

We shouldn’t set false values to any boolean atrributes. because as per docs, the default is already false. If you send empty payload it will pull all the records.

yeah okay. but true also doesn’t change the output. was trying to check the difference.

1 Like

thats not working, i also had tested it.

Hi @sindhu_veladi,

let me quickly clarify the mentioned APIs here:

  1. the filter for “active” tasks excludes those that belong to suspended process instances, not those that are completed
  2. as @aravindhrs mentioned, you can use the historic tasks to query for completed tasks and running tasks alike as we keep the history for all of them

So in order for the “active” attribute set to “true” making a difference in your queries, you would need to have a suspended a process instance containing an unfinished task first.

Hope that clarifies things.

Best regards
Tobias

1 Like

@tmetzke thanks for the clarification.