Check if Queue Item has been postponed

Can I tell from a QueueItem weather it has been postponed or not?

My scenario is that I want certain items to have a delay of 7 days before they are processed however I need to be able to tell which items have been postponed?

1 Like

Hi @ConorSmalley

Actually, there is a postpone value when adding a queue item:

Postpone - The date after which the queue item may be processed. This property is a criterion for the prioritization of queue items, alongside Priority and Due Date . This property can be filled in with relative dates such as DateTime.Now.AddHours(2) , DateTime.Now.AddDays(10) and DateTime.Now.Add(New System.TimeSpan(5, 0, 0, 0)) . Additionally, you can use the US notation to add an exact time, such as 1 2/10/2017 07:40:00 . Automatically correcting this date is available. For example, if you write 8 9 2018 9:0 , it is automatically transformed to 08/09/2018 09:00:00 .

2 Likes

Hi @loginerror

I have read the UiPath documentation and I know how to postpone a queue item, that wasn’t the question I asked.

What I would like to know is that when I process the Queue Item once it has been postponed how can I check if it has been postponed? Not all of my Queue Items will be postponed so I need to identify them

Actually, my intuitive understanding of this feature was that postponed items will simply not be fetched until the condition is met. I haven’t tested it though.

I tested it just now - the item is simply not fetched from the Queue until the date is passed :slight_smile:

In Orchestrator:

And in Studio when trying to fetch it with Get Transaction Item activity:
image

1 Like

To add to it, you can also log the items that are being postponed by you so there you go, it will serve your purpose.

If someone else or the bot is postponing it(although it can also be logged) you can change the priority of the item and get those items by filtering them according to that property using ‘Get queue items’.

Well if you are using priorities in your project, then maybe if you know a ‘standard’ postponement days then (although I have not tested it myself) you can get the items from the property ‘minimum creation date’ (tell me whether it works)

Maybe even ‘delete’ that item and add it instantly with a deferred date and all your deleted items are your deferred/postponed queueitems.

I would go with logging just a primary/reference ID if there are security issues, if you come up with a more optimal solution please do post it here.

Regards :slight_smile:

So as an example,

  • I run the load today to populate the queue, and it puts 10 items in the queue
  • I run the process and 4 items are postponed for 7 days and 6 items are processed today

1 week later

  • I run the load and it populates the queue with 5 items, meaning that there are 9 items in the queue, 4 from 7 days ago and 5 from today
  • I run the process on the 9 transaction items. How do I know which items were added last week and which item’s were added today, as they may need to be treated differently?

I think the easiest would be to add an extra field in the queue item itself with its status. Would it work for you to create additional field, i.e.
itemStatus = postponed
or even
postponed since = date of adding the queue

You could then handle that in your process with a simple IF statement or a switch, depending on the amount of conditions you need to check for.

1 Like

I’ve ended up adding a field with the date an item is added to the Queue.

I wasn’t sure if there was an easy way to check if an item has been postponed without the need of an additional field.

2 Likes

Have a check on the Activity: Get Queue Items
With help of this you can retrieve the existing queue/transaction items
Maybe you can configure some filter criteria directly and/or you will use LINQ afterwards
The TransactionItem properties: DeferDate, DueDate may allows you to identify the items directly without the need of adding additional fields.

1 Like

@ppr
Hello, I can’t extract these fields from orchestrator.
I’m using in_TransactionItem.DueDate.ToString
DueDate apear from a dropdown menu and I select this property. And convert it to string.
Store in my variable which is String. But in the message box shows me nothing.
When I check for this TransactionItem I see in orchestrator I have DueDate.

EDIT:
It’s worked but it’s strange.
If I edit something manually in the orchestrator to put Due Date for the next item from the queue.
When he is taken by the robot I receive empty string for this exact queue item.

When I filter to take exact this queue item from Get Queue Items activity I can see the due date.

No idea why when after edit something manually didn’t refresh the next queue items.

What did you mean by adding an extra field? I thought you cannot change transaction specific content once the transaction is already in the queue?

I think it is possible via an API call. On my way to verify, I also found this example, which kind of solves @ConorSmalley original issue of fetching item history:
https://docs.uipath.com/orchestrator/reference/retrieving-specific-transactions#section-viewing-the-history-of-an-item

There is also an endpoint to update your queue item:

For details on how to get the swagger definition file, see here:
https://docs.uipath.com/orchestrator/reference/api-references

1 Like