I am using the Rest API POST /history/process-instance endpoint to get all process instances and I would like to sort the response by the value of a process variable.
Example:
I have process instances with the process variable lastName. I would like to sort my process instances by lastName so that I can show all process instances in a sorted dashboard.
I would also like to sort the POST /history/task endpoint response by process variable.
This behavior seems to be supported in the POST /task endpoint (but not the POST /process-instance endpoint) by:
"sorting":
[{"sortBy": "processVariable",
"sortOrder": "desc",
"parameters": {
"variable": "lastName",
"type": "String"
}}]
Based on the API documentation (Get Process Instances (POST) | docs.camunda.org and Get Task (Historic) (POST) | docs.camunda.org), sorting by process variables is not supported in the same way.
Is there any way to sort the responses from the /history/task or /history/process-instance endpoints by process variable? Has anyone else come across this issue?