如何提取特定用户的所有任务 ID IBM BPM

How to extract all task ID's for a specific user IBM BPM

我正在尝试在 IBM BPM REST API 测试器中为特定用户(使用用户名)提取任务 ID。

我试过使用以下命令,但它没有 return 任务 ID

rest/bpm/wle/v1/search/query?columns=taskId%2C&condition=userName%7COSHVWYK&organization=byInstance&run=true&shared=false&filterByCurrentUser=false

您的条件格式错误。在 IBM BPM 8.6 上转到 REST API Tester / Business Process Manager REST APIs / Search API / 运行 Query [deprecated] 并将 Condition 指定为 assignedToUser|Equals|user123 (将 user123 替换为真实用户名); 请注意,Condition 中允许的列列表在 /rest/bpm/wle/v1/search/meta/constraintColumn 下可用。添加到 ColumnstaskId 将缩小返回的数据集,因此这是可选的。

结果 URL 看起来是这样的: rest/bpm/wle/v1/search/query?condition=assignedToUser%7CEquals%7Cuser123&organization=byInstance&run=true&shared=false&filterByCurrentUser=false

结果集的结构如下:

{
    "status": "200",
    "data": {
        "data": [{
                "assignedToRole": null,
                "taskAssignedTo": {
                    "type": "User",
                    "who": "user123"
                },
                "instanceId": 308611,
                "instanceStatus": "Terminated",
                "taskAttachedExtActivityRef": null,
                "taskAttachedInfoPathFormRef": null,
                "taskId": 613750,
                "taskStatus": "Closed"
            }, {
                "assignedToRole": null,
                "taskAssignedTo": {
                    "type": "User",
                    "who": "user123"
                },
                "instanceId": 308622,
                "instanceStatus": "Terminated",
                "taskAttachedExtActivityRef": null,
                "taskAttachedInfoPathFormRef": null,
                "taskId": 613763,
                "taskStatus": "Closed"
            }, ... ]
    }
}