Fetch Next
This synchronous integration point allows a user to fetch and auto-assign the next best work item available to them.
Request
This API supports the following POST operation:
POST http://[hostName]:[portNumber]/[api-context-root]/workitems/fetchnext
Details
-
Work items are excluded from the eligible pool if any of the following conditions is true:
-
IND_HOLD = Y -
Status is
Awaiting FeedbackorDone
-
Selection
Assigned Work Item First
-
The integration point first searches for work items already assigned to the requesting user that are in a status other than
Awaiting FeedbackorDone. -
The sort order defined below is applied and the top-ranked work item is selected.
Unassigned Work Item Second
-
The requesting user must hold Queue User role access. Only work items belonging to those queues are considered by the selection.
-
If no assigned work item is found, the integration point searches for unassigned work items, identified by a null assignee and a status of
Open. -
The same sort order is applied and the top-ranked work item is selected.
-
On selection, the work item status is updated from
OpentoIn Progress, the work item is assigned to the requesting user, and theassigned byvalue is set to the system user. The work item record is updated, and a work item history entry is written to record the assignment event.
Sort
The following sort order is applied in both selection steps:
| # | Attribute | Sort Rule |
|---|---|---|
1 |
Escalated Indicator |
Descending: Y sorts before N |
2 |
Work Item SLA Due Time |
Ascending, nulls last |
3 |
Global SLA Due Time |
Ascending, nulls last |
4 |
Priority |
Ascending, nulls last |
5 |
Work Item Creation Time |
Ascending |
Response
On successful selection, the integration point returns HTTP 200.
{
"links" : [ {
"rel" : "self",
"href" : "http://[hostName]:[portNumber]/[api-context-root]/api/generic/workitems/41019527",
"httpMethod" : "GET"
}, {
"rel" : "subject",
"href" : "http://[hostName]:[portNumber]/[api-context-root]/api/generic/authorizations/51078031",
"httpMethod" : "GET"
} ]
}
Response Messages
Failure
| Code | Description |
|---|---|
OHI-IP-WTSK-015 |
No eligible work item available. |
The response can also contain generic error messages not specific to this web service. For more information, see Response Messages.
Example
Scenario Setup
Assume the current time is Monday, 20 April 2026, 10:00 IST. The requesting user holds Queue User role on two enabled queues: Auth-Reviewer and Auth-Approver. The eligible pool contains the following six work items: three currently assigned to the user and three unassigned.
| Work Item | Status | Assignee | Escalated | Task SLA Due | Global SLA Due | Priority | Created |
|---|---|---|---|---|---|---|---|
WIT-1001 |
In Progress |
self |
Y |
20 Apr 14:00 |
21 Apr 09:00 |
50 |
18 Apr 09:00 |
WIT-1002 |
Open |
(null) |
Y |
20 Apr 11:00 |
20 Apr 18:00 |
10 |
19 Apr 08:00 |
WIT-1003 |
Open |
(null) |
N |
20 Apr 10:30 |
(null) |
5 |
20 Apr 07:00 |
WIT-1004 |
Open |
(null) |
N |
(null) |
20 Apr 12:00 |
1 |
19 Apr 06:00 |
WIT-1005 |
In Progress |
self |
Y |
20 Apr 11:00 |
20 Apr 15:00 |
10 |
19 Apr 08:00 |
WIT-1006 |
In Progress |
self |
Y |
20 Apr 11:00 |
20 Apr 15:00 |
10 |
19 Apr 07:00 |
Assigned-First Selection
The integration point considers only the three work items already assigned to the user: WIT-1001, WIT-1005, and WIT-1006. The sort narrows them progressively:
| # | Criterion Applied | Remaining Set |
|---|---|---|
1 |
Escalated = Y, descending. All three are Y. |
WIT-1001, WIT-1005, WIT-1006 |
2 |
Task SLA ascending. WIT-1005 and WIT-1006 at 11:00 beat WIT-1001 at 14:00. |
WIT-1005, WIT-1006 |
3 |
Global SLA ascending. Both are at 15:00, so the items are still tied. |
WIT-1005, WIT-1006 |
4 |
Priority ascending. Both are at 10, so the items are still tied. |
WIT-1005, WIT-1006 |
5 |
Creation time ascending. WIT-1006 (07:00) is older than WIT-1005 (08:00). |
WIT-1006 |
Result: WIT-1006 is selected.
Unassigned Selection
Assume WIT-1001, WIT-1005, and WIT-1006 are not eligible. The user has no assigned work items, so the integration point evaluates the unassigned pool: WIT-1002, WIT-1003, and WIT-1004. Applying the same sort:
| # | Criterion Applied | Remaining Set |
|---|---|---|
1 |
Escalated Y first. WIT-1002 is Y; WIT-1003 and WIT-1004 are N. |
{WIT-1002} |
Not applicable |
Already narrowed to a single work item; remaining criteria are not needed. |
Result: WIT-1002 is selected.