Using Orchestrator API ,I am trying to fetch QueueItems based on their status.Here is my API URL
“/odata/QueueItems?$filter=QueueDefinitionId eq “+QueueID+”&$Status eq UiPath.Core.Model.Queues.ProcessingStatus”+“'”+StatusQryStr+“'”
I am passing QueueID and StatusQryStr as input paramters to this url.But API is fetching all the Queueitems irrespective of StatusQryStr what I sent.For ex. if I send StatusQryStr as ‘New’, it is fetching all the queueitems i.e.Successful,InProgress etc.Is there anything wrong in the URL that I customized?Can u pls help me here to fetch items based on the StatusQryStr(status what I send as i/p).
@lilly - may I know why you are trying to fetch queue items using API and why not from Get Transaction Item activity (with this you don’t have to mention the status, it will take the New items automatically)?
Cant I get the same using the Orchestrator API with multiple filter options.
“/odata/QueueItems?$filter=QueueDefinitionId eq “+QueueID+”&$Status eq UiPath.Core.Model.Queues.ProcessingStatus”+“’”+StatusQryStr+“’”.
You can simple use Get Queue Items Activity, There is property called QueueItemStates, Click the check box (states), It will return a list of queue items, which you can use further as per requirement in the project.
Thanks ranjith but i have condition to use only orchestrator api…is there any solution for that??
i tried /odata/QueueItems?$filter=QueueDefinitionId eq id & $Status eq Failed…but it’s not working
Try this one: {{url}}//odata/QueueItems?$filter=QueueDefinitionId eq id and Status eq ‘Failed’. Instead of URL paste the url of your orchestrator.
Strings must include quotes in filtering, int are without them. Similar topic is linked. You can find there multiple filter condition and also which functions/logic which can be used https://forum.uipath.com/t/orchestrator-api-query-functions/185719
The solution is to add single quotes in status value.
Example:
“/odata/QueueItems?$filter=QueueDefinitionId eq “+QueueID+”&$Status eq ‘New’”
Let me know if it works and if it works mark as solution