getAgentWorks for Lightning Experience

Returns a list of work items that are assigned to an agent and open in the agent’s workspace.

Component code:

Controller code:

This method returns a promise that, upon success, resolves to an array of work objects, containing the following fields.

NameTypeDescription
workItemIdStringThe ID of the object that’s routed through Omni-Channel. This object becomes a work assignment with a workId when it’s assigned to an agent.
workIdStringThe ID of a work assignment that’s routed to an agent.
isEngagedBooleanIndicates whether an agent is working on a work item that’s been assigned to them (true) or not (false).