How to search Human Tasks on Business Data attribute?

Hi all,

How to use REST APIs to search human tasks on specific business data attribute?

For example, I have a common BDM which indicate customers (say by CustomerId), there could be serveral processes having this BDM as business variable, therefore many cases will be created with different processes, also with different CustomerId value. I would like to look for all tasks (regardless pending or completed) which root case has a specific CustomerID.

We can search for cases first, and then use case id as filter in HumanTask API, however it could exceed SQL statement length limitation hence not an option.