Tasklist apply custom form search filter version 7.22

Hi,

for project needs I need to disable the native search on the tasklist and activate a new search by creating a plugin to place in place of the old one.

I have already created the plugin by placing it in this position (pluginPoint: “tasklist.list”).

export default {
id: “tasklist.process.custom-search”,
pluginPoint: “tasklist.list”,
priority: 1000,

render: (node, { api }) => {
	...
}

}

immagine

I currently see the search form with my fields
but I can’t hook up to the tasklist search to add my filters.

in the plugin i am trying to use the api parameter that contains this information
but whatever endpoint I use it gives me 403
api::{
“adminApi”:“/my-path/api/admin”,
“baseApi”:“/my-path/api/engine”,
“cockpitApi”:“/my-path/api/cockpit”,
“tasklistApi”:“/my-path/api/tasklist”,
“engineApi”:“/my-path/api/engine/engine/default”,
“engine”:“default”,
“CSRFToken”:“xxx…”
}

es…
fetch(api.engineApi + “path del rest”, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘X-CSRF-TOKEN’: api.CSRFToken
},
body: JSON.stringify(filters)

is this the correct way?
Could you point me to some resources to see how to complete the implementation of this plugin?

Thank you

Hi carbonem,

I’m not sure if this is the best practice, but one possible solution could be the following:

Instead of calling the API directly, you could pass the filter parameters via the URL. Camunda Tasklist uses GET parameters to apply search filters without requiring a full page reload.

For example, a URL with filter parameters might look like this:

?searchQuery=%5B%7B"type":"processVariables","operator":"eq","value":"1234","name":%7B"key":"ProblemNr","value":"Ticket%20(TicketNr)"%7D%7D%5D&filter=1788a4fb-e231-11ee-87dc-52540a1f0687&sorting=%5B%7B"sortBy":"created","sortOrder":"desc"%7D%5D

By updating the URL dynamically with JavaScript when a search is performed, Camunda will automatically apply the filter without requiring a page reload.

You could modify the URL parameters according to your needs within your custom plugin, ensuring seamless integration with the Tasklist.

I can’t say for certain if this is the best practice, but it should work. Hopefully, this helps as a starting point.

Also, if possible, could you share your current plugin implementation for replacing the default filtering? I’m working on something similar and would love to see how you approached it.

thanks lul,

I did exactly that and I confirm that it works.
in my plugin I manage the search parameters in the URL by updating it via js.