Hi everyone,
I'm testing the K2 Five version 5.6 and 5.9.1 Workflow REST API and have a question about filtering tasks.
GET /Api/Workflow/V1/tasks
I receive data like:
{
"serialNumber": "132_7",
"workflowName": "Ya\\assignTaskWF",
"workflowDisplayName": "assignTaskWF",
"workflowCategory": "Ya"
}
I tried filtering by workflow name:
GET /Api/Workflow/V1/tasks?$filter=workflowName eq 'Ya\\assignTaskWF'
However, the response still returns tasks from other workflows as well.
From the Swagger documentation for GET /tasks, I only see the following query parameter:
state
and I do not see $filter documented.
My questions are:
- Does
GET /Api/Workflow/V1/taskssupport OData-style$filterparameters? - Is
workflowNamea valid filter field? - Is there a supported way to retrieve tasks for a specific workflow only?
- If filtering is not supported, is the recommended approach to retrieve all tasks and filter on the client side?
- Is there another endpoint available that supports filtering by workflow name or workflow instance?
GET /Api/Workflow/V1/tasks?$filter=workflowName eq 'Ya\\assignTaskWF'
Expected:
[
{
"workflowName": "Ya\\assignTaskWF"
}
]
Actual:
[
{
"workflowName": "Ya\\assignTaskWF"
},
{
"workflowName": "example\\assignTaskexampleWF"
}
]
Any guidance would be appreciated.
Thanks!