Posting to the /history/task endpoint via the Rest API does not seem to work when trying to filter tasks by process variables using the operator “like”. Example POST body:
I’m not sure you’ll consider this a “workaround”, but you can just go directly to the database. In our case we use MySQL, that’s what the following will address. We’re using Camunda 7.6.2. Assume the back end Camunda database is called “camunda”. You can adjust the columns returned as needed.
These statements apply to variables stored in the TEXT_ column of the database.
This will get you historical variables:
SELECT * FROM camunda.ACT_HI_VARINST WHERE NAME_ LIKE 'Bob%';
If you want runtime (running processes) variables, use this:
SELECT * FROM camunda.ACT_RU_VARIABLE WHERE NAME_ LIKE 'Bob%';
These statements apply variables stored in the ACT_GE_BYTEARRAY table. These variables are generally objects or over 4000 characters.
This will get you historical variable values and process instance IDs (adjust columns returned as needed):
SELECT
ACT_GE_BYTEARRAY.NAME_
, ACT_GE_BYTEARRAY.BYTES_
, ACT_HI_VARINST.PROC_INST_ID_
FROM
camunda_db.ACT_HI_VARINST
INNER JOIN camunda_db.ACT_GE_BYTEARRAY
ON (ACT_RU_VARIABLE.BYTEARRAY_ID_ = ACT_GE_BYTEARRAY.ID_)
WHERE (ACT_GE_BYTEARRAY.NAME_ LIKE 'Bob%');
This will get you running process variables:
SELECT
ACT_GE_BYTEARRAY.NAME_
, ACT_GE_BYTEARRAY.BYTES_
, ACT_RU_VARIABLE.PROC_INST_ID_
FROM
camunda_db.ACT_RU_VARIABLE
INNER JOIN camunda_db.ACT_GE_BYTEARRAY
ON (ACT_RU_VARIABLE.BYTEARRAY_ID_ = ACT_GE_BYTEARRAY.ID_)
WHERE (ACT_GE_BYTEARRAY.NAME_ LIKE 'Bob%');
I have checked the codebase and like operator is in reality not supported in this REST API call, as well as all others, apart from eq. Underlying API also does not have methods providing support for other operators. I think this is a copy-paste issue of documentation. If you want, you can contribute a pull request with adjustment of documentation.