How to fetch the Postpone time for an transaction in queues

Hi All,

I need to fetch the postponed time from the below ss:
Please help me on this

I need to get 2/16/2025, 3:14:39 PM and so on

@naveen.s,

You can use Get Queue items or Orchestrator API for this.

With API use this end point

/odata/QueueItems

1 Like

The “Get Queue Items” activity has a limitation of fetching up to 100 transaction items, and you can apply filters within this activity.

If you expect the number of transaction items to exceed 100, it is recommended to use the API to retrieve them. This allows you to apply filters, including those based on the postpone date.

@naveen.s

get queue item will get all items

and from those you can get the postponed time for each item as needed

cheers

Hello,
You can achieve this by using the Orchestrator HTTP Request activity. I have attached a workflow that implements the solution. Below is an overview of the steps and how the workflow is structured to accomplish the task:
FetchPostponeTime.zip (99.0 KB)

  1. Orchestrator HTTP Request (Queue Definitions):
  • The first activity makes a GET request to the Orchestrator API endpoint (odata/QueueDefinitions).
  • It stores the response in a variable QueueDefinitionResponse.
  1. Deserialize JSON (Queue Definition Response):
  • This activity deserializes the JSON response from the Orchestrator HTTP request (QueueDefinitionResponse) into a jsonObject variable (type JObject).
  1. Initialize Queue Name Dictionary:
  • A dictionary variable QueueNameDictionary is initialized as an empty dictionary.
  1. For Each - Iterate Over Queue Definitions:
  • The next activity is a For Each loop that iterates over each item in the jsonObject("value"), which is a list of queue definitions.
  • Within the loop, the queueName and queueId are extracted from the current JSON token (currentJToken) by looking for the “Name” and “Id” properties.
  • The extracted queueName is used as the key, and queueId as the value to populate the QueueNameDictionary. Should look like this:
For Each jsonObject("value")
   Assign - queueName = currentJToken.Children(Of JProperty)().FirstOrDefault(Function(prop) prop.Name = "Name").Value.ToString()
   Assign - queueId = currentJToken.Children(Of JProperty)().FirstOrDefault(Function(prop) prop.Name = "Id").Value.ToString()
   Assign - dict_QueueNames(queueName) = queueId
  1. Orchestrator HTTP Request (Queue Items):
  • Another GET request is made to the Orchestrator API endpoint (odata/QueueItems) to fetch queue items, with the response stored in OrchestratorHttpRequestResponse.
  1. Deserialize JSON (Queue Items Response):
  • The OrchestratorHttpRequestResponse is then deserialized into a jsonObject variable.
  1. Initialize Postpone Transactions List Of Tuples:
  • A new list of Tuple PostPoneTransactionsListTuple is initialized as an empty list to store postponed transaction data.
  1. Populate Postpone Transactions List of Tuple:
  • A second assignment activity filters the queue items based on certain conditions:
    • The QueueDefinitionId in each item should match the value from QueueNameDictionary for a given in_QueueName.
    • The DeferDate should not be empty.
  • A tuple is created with the Reference and DeferDate properties of each matching item, which is added to the PostPoneTransactionsListTuple. This is done with the following:
Declare the PostPoneTransactionsListTuple variable:
Assign - PostPoneTransactionsListTuple = New List(Of Tuple(Of String, String))()

Fill PostPoneTransactionsListTuple with the filtered information:
Assign - PostPoneTransactionsListTuple = jsonObject("value").Where(Function(item) item.Children(Of JProperty)().Any(Function(prop) prop.Name = "QueueDefinitionId" AndAlso prop.Value.ToString() = dict_QueueNames(in_QueueName)) AndAlso item.Children(Of JProperty)().Any(Function(prop) prop.Name = "DeferDate" AndAlso Not String.IsNullOrEmpty(prop.Value.ToString()))).Select(Function(item) Tuple.Create(item.Children(Of JProperty)().FirstOrDefault(Function(prop) prop.Name = "Reference").Value.ToString(), item.Children(Of JProperty)().FirstOrDefault(Function(prop) prop.Name = "DeferDate").Value.ToString())).ToList()

How to Obtain the Property Names from a jsonObject:

  1. For Each - Iterate Over JSON Tokens:
  • The workflow starts by iterating over the JSON array jsonObject("value"). This is done using a For Each loop, where each element in the array is a JToken.
  • This allows you to inspect each item in the array.
  1. For Each - Iterate Over JSON Properties:
  • For each currentJToken (an individual item in the JSON array), a second For Each loop is used to iterate over its properties (JProperty). The Children(Of JProperty)() method is used to fetch all properties of the JToken. It should look something like this:
For Each jobject("value")
   For Each currentJToken.Children(Of JProperty)().ToList
     Log = currentJProperty
  1. Log JSON Property Names:
  • Inside the nested loop, the LogMessage activity is used to log each property (currentJProperty). This will display the property names and values in the logs.
  1. What Happens in the Logs:
  • The log message will show the name and value of each property in the currentJProperty (which represents a key-value pair in the JSON object). This allows you to see all the available properties of the jsonObject in the workflow.